summaryrefslogtreecommitdiff
path: root/src/ftcrfont.c
diff options
context:
space:
mode:
authorAlexander Gramiak <agrambot@gmail.com>2019-05-10 09:45:57 -0600
committerAlexander Gramiak <agrambot@gmail.com>2019-05-19 19:50:32 -0600
commita4fe9c70af7a60117480d3361541550341da801a (patch)
treef9c082b94c2af6df79f7aa66dbcce4a97eabbbbd /src/ftcrfont.c
parentb3d3c0daa49f5cbed7c58c7508d4d36dba3757e5 (diff)
downloademacs-a4fe9c70af7a60117480d3361541550341da801a.tar.gz
Replace XChar2b with unsigned in all font backends
The xfont backend using XChar2b in its API doesn't mean that we should use it everywhere else. * src/dispextern.h (glyph_string): * src/ftcrfont.c (ftcrfont_draw): * src/ftxfont.c (ftxfont_draw): * src/w32term.c (w32_draw_glyphless_glyph_string_foreground): * src/xdisp.c (init_glyph_string, get_char_face_and_encoding) (get_glyph_face_and_encoding, get_char_glyph_code) (fill_gstring_glyph_string, fill_stretch_glyph_string) (normal_char_ascent_descent, gui_get_glyph_overhangs) (compute_overhangs_and_x, gui_produce_glyphs): * src/xfont.c (xfont_get_pcm, xfont_chars_supported, xfont_open) (xfont_encode_char, xfont_text_extents, xfont_draw) * src/xftfont.c (xftfont_draw): * src/xterm.c (x_compute_glyph_string_overhangs) (x_draw_glyphless_glyph_string_foreground): Use unsigned over XChar2b. * src/nsgui.h: * src/w32gui.h: * src/xterm.h: Remove XChar2b, STORE_XCHAR2B, XCHAR2B_BYTE1, and XCHAR2B_BYTE2 typedefs and macros. * src/font.h (font_driver): (ftfont_text_extents) * src/ftcrfont.c (ftcrfont_text_extents): * src/ftfont.c (ftfont_text_extents): * src/macfont.m (macfont_text_extents): * src/nsfont.m (nsfont_text_extents): * src/w32font.h (w32_font_text_extents): * src/font.c (xfont_text_extents): * src/xftfont.c (xftfont_text_extents): Make code parameter const.
Diffstat (limited to 'src/ftcrfont.c')
-rw-r--r--src/ftcrfont.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/ftcrfont.c b/src/ftcrfont.c
index e7c73eac4d3..606db0b949b 100644
--- a/src/ftcrfont.c
+++ b/src/ftcrfont.c
@@ -242,7 +242,7 @@ ftcrfont_close (struct font *font)
static void
ftcrfont_text_extents (struct font *font,
- unsigned *code,
+ const unsigned *code,
int nglyphs,
struct font_metrics *metrics)
{
@@ -341,13 +341,12 @@ ftcrfont_draw (struct glyph_string *s,
glyphs = alloca (sizeof (cairo_glyph_t) * len);
for (i = 0; i < len; i++)
{
- unsigned code = ((XCHAR2B_BYTE1 (s->char2b + from + i) << 8)
- | XCHAR2B_BYTE2 (s->char2b + from + i));
-
- glyphs[i].index = code;
+ glyphs[i].index = s->char2b[from + i];
glyphs[i].x = x;
glyphs[i].y = y;
- x += (s->padding_p ? 1 : ftcrfont_glyph_extents (s->font, code, NULL));
+ x += (s->padding_p ? 1 : ftcrfont_glyph_extents (s->font,
+ glyphs[i].index,
+ NULL));
}
x_set_cr_source_with_gc_foreground (f, s->gc);