summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/mupdf/fitz/font.h26
-rw-r--r--source/fitz/font.c2
2 files changed, 14 insertions, 14 deletions
diff --git a/include/mupdf/fitz/font.h b/include/mupdf/fitz/font.h
index 484273a5..2547e7a0 100644
--- a/include/mupdf/fitz/font.h
+++ b/include/mupdf/fitz/font.h
@@ -30,21 +30,23 @@ struct fz_font_s
char name[32];
fz_buffer *buffer;
- char is_mono;
- char is_serif;
- char is_bold;
- char is_italic;
+ unsigned int is_mono : 1;
+ unsigned int is_serif : 1;
+ unsigned int is_bold : 1;
+ unsigned int is_italic : 1;
+ unsigned int ft_substitute : 1; /* use substitute metrics */
+ unsigned int ft_stretch : 1; /* stretch to match PDF metrics */
+
+ unsigned int fake_bold : 1; /* synthesize bold */
+ unsigned int fake_italic : 1; /* synthesize italic */
+ unsigned int force_hinting : 1; /* force hinting for DynaLab fonts */
+ unsigned int has_opentype : 1; /* has opentype shaping tables */
+ unsigned int invalid_bbox : 1;
+ unsigned int use_glyph_bbox : 1;
void *ft_face; /* has an FT_Face if used */
void *hb_font; /* hb_font for shaping */
void (*hb_destroy)(void *); /* Destructor for hb_font */
- int ft_substitute; /* ... substitute metrics */
- int ft_stretch; /* ... and stretch to match PDF metrics */
-
- int fake_bold; /* ... synthesize bold */
- int fake_italic; /* ... synthesize italic */
- int force_hinting; /* ... force hinting for DynaLab fonts */
- int has_opentype; /* ... has opentype shaping tables */
fz_matrix t3matrix;
void *t3resources;
@@ -56,13 +58,11 @@ struct fz_font_s
void (*t3run)(fz_context *ctx, void *doc, void *resources, fz_buffer *contents, struct fz_device_s *dev, const fz_matrix *ctm, void *gstate, int nestedDepth);
void (*t3freeres)(fz_context *ctx, void *doc, void *resources);
- char invalid_bbox;
fz_rect bbox; /* font bbox is used only for t3 fonts */
int glyph_count;
/* per glyph bounding box cache */
- int use_glyph_bbox;
fz_rect *bbox_table;
/* substitute metrics */
diff --git a/source/fitz/font.c b/source/fitz/font.c
index a291eab8..560f96ec 100644
--- a/source/fitz/font.c
+++ b/source/fitz/font.c
@@ -59,7 +59,7 @@ fz_new_font(fz_context *ctx, const char *name, int use_glyph_bbox, int glyph_cou
font->glyph_count = glyph_count;
- font->use_glyph_bbox = use_glyph_bbox;
+ font->use_glyph_bbox = !!use_glyph_bbox;
if (use_glyph_bbox && glyph_count <= MAX_BBOX_TABLE_SIZE)
{
font->bbox_table = fz_malloc_array(ctx, glyph_count, sizeof(fz_rect));