Lines Matching defs:font_info

169 add_glyph (struct grub_font_info *font_info, FT_UInt glyph_idx, FT_Face face,
181 if (font_info->flags & GRUB_FONT_FLAG_NOBITMAP)
184 if (font_info->flags & GRUB_FONT_FLAG_NOHINTING)
186 else if (font_info->flags & GRUB_FONT_FLAG_FORCEHINT)
209 if (font_info->flags & GRUB_FONT_FLAG_BOLD)
273 glyph_info->next = font_info->glyphs_unsorted;
274 font_info->glyphs_unsorted = glyph_info;
275 font_info->num_glyphs++;
284 if (width > font_info->max_width)
285 font_info->max_width = width;
287 if (height > font_info->max_height)
288 font_info->max_height = height;
290 if (glyph_info->y_ofs < font_info->min_y && glyph_info->y_ofs > -font_info->size)
291 font_info->min_y = glyph_info->y_ofs;
293 if (glyph_info->y_ofs + height > font_info->max_y)
294 font_info->max_y = glyph_info->y_ofs + height;
315 add_char (struct grub_font_info *font_info, FT_Face face,
324 add_glyph (font_info, glyph_idx, face, char_code, nocut);
328 add_glyph (font_info, cur->to, face,
344 add_glyph (font_info, idx2, face,
354 add_glyph (font_info, cur->to, face,
370 add_glyph (font_info, idx2, face,
379 add_glyph (font_info, cur->to, face,
396 add_glyph (font_info, idx2, face,
611 add_font (struct grub_font_info *font_info, FT_Face face, int nocut)
680 if (font_info->num_range)
685 for (i = 0; i < font_info->num_range; i++)
686 for (j = font_info->ranges[i * 2]; j <= font_info->ranges[i * 2 + 1];
688 add_char (font_info, face, j, nocut);
697 add_char (font_info, face, char_code, nocut);
731 print_glyphs (struct grub_font_info *font_info)
737 for (glyph = font_info->glyphs_sorted, num = 0; num < font_info->num_glyphs;
757 if (ymax < font_info->asce)
758 ymax = font_info->asce;
761 if (ymin > - font_info->desc)
762 ymin = - font_info->desc;
788 (y >= - font_info->desc) &&
789 (y < font_info->asce))
803 write_font_ascii_bitmap (struct grub_font_info *font_info, char *output_file)
814 for (glyph = font_info->glyphs_sorted, num = 0; num < font_info->num_glyphs;
836 write_font_width_spec (struct grub_font_info *font_info, char *output_file)
849 for (glyph = font_info->glyphs_sorted;
850 glyph < font_info->glyphs_sorted + font_info->num_glyphs; glyph++)
860 write_font_pf2 (struct grub_font_info *font_info, char *output_file)
881 if (! font_info->name)
882 font_info->name = "Unknown";
884 if (font_info->flags & GRUB_FONT_FLAG_BOLD)
885 font_info->style |= FT_STYLE_FLAG_BOLD;
888 if (font_info->style & FT_STYLE_FLAG_BOLD)
891 if (font_info->style & FT_STYLE_FLAG_ITALIC)
897 font_name = xasprintf ("%s %s %d", font_info->name, &style_name[1],
898 font_info->size);
903 font_info->name, &offset, file);
905 (font_info->style & FT_STYLE_FLAG_BOLD) ?
909 (font_info->style & FT_STYLE_FLAG_ITALIC) ?
914 font_info->size, &offset, file);
916 font_info->max_width, &offset, file);
918 font_info->max_height, &offset, file);
920 if (! font_info->desc)
922 if (font_info->min_y >= 0)
923 font_info->desc = 1;
925 font_info->desc = - font_info->min_y;
928 if (! font_info->asce)
930 if (font_info->max_y <= 0)
931 font_info->asce = 1;
933 font_info->asce = font_info->max_y;
937 font_info->asce, &offset, file);
939 font_info->desc, &offset, file);
944 printf ("Max width: %d\n", font_info->max_width);
945 printf ("Max height: %d\n", font_info->max_height);
946 printf ("Font ascent: %d\n", font_info->asce);
947 printf ("Font descent: %d\n", font_info->desc);
951 printf ("Number of glyph: %d\n", font_info->num_glyphs);
953 leng = grub_cpu_to_be32 (font_info->num_glyphs * 9);
958 offset += 8 + font_info->num_glyphs * 9 + 8;
960 for (cur = font_info->glyphs_sorted;
961 cur < font_info->glyphs_sorted + font_info->num_glyphs; cur++)
979 for (cur = font_info->glyphs_sorted;
980 cur < font_info->glyphs_sorted + font_info->num_glyphs; cur++)
1002 struct grub_font_info font_info;
1009 memset (&font_info, 0, sizeof (font_info));
1026 font_info.flags |= GRUB_FONT_FLAG_BOLD;
1030 font_info.flags |= GRUB_FONT_FLAG_NOBITMAP;
1034 font_info.flags |= GRUB_FONT_FLAG_NOHINTING;
1038 font_info.flags |= GRUB_FONT_FLAG_FORCEHINT;
1046 font_info.name = optarg;
1069 if ((font_info.num_range & (GRUB_FONT_RANGE_BLOCK - 1)) == 0)
1070 font_info.ranges = xrealloc (font_info.ranges,
1071 (font_info.num_range +
1075 font_info.ranges[font_info.num_range * 2] = a;
1076 font_info.ranges[font_info.num_range * 2 + 1] = b;
1077 font_info.num_range++;
1093 font_info.desc = strtoul (optarg, NULL, 0);
1097 font_info.asce = strtoul (optarg, NULL, 0);
1126 if (file_format == ASCII_BITMAPS && font_info.num_range > 0)
1134 font_info.ranges = xrealloc (font_info.ranges,
1138 font_info.ranges[0] = (grub_uint32_t) 0x00;
1139 font_info.ranges[1] = (grub_uint32_t) 0x7f;
1140 font_info.num_range = 1;
1168 if ((! font_info.name) && (ft_face->family_name))
1169 font_info.name = xstrdup (ft_face->family_name);
1181 font_info.style = ft_face->style_flags;
1182 font_info.size = size;
1186 add_font (&font_info, ft_face, file_format != PF2);
1199 for (cur = font_info.glyphs_unsorted; cur; cur = cur->next)
1203 tmp = xmalloc (font_info.num_glyphs
1205 for (cur = font_info.glyphs_unsorted; cur; cur = cur->next)
1210 for (cur = tmp; cur < tmp + font_info.num_glyphs; cur++)
1214 font_info.glyphs_sorted = xmalloc (font_info.num_glyphs
1215 * sizeof (font_info.glyphs_sorted[0]));
1216 for (cur = tmp; cur < tmp + font_info.num_glyphs; cur++)
1217 font_info.glyphs_sorted[counter[(cur->char_code & 0xffff0000) >> 16]++]
1225 write_font_pf2 (&font_info, output_file);
1229 write_font_ascii_bitmap (&font_info, output_file);
1233 write_font_width_spec (&font_info, output_file);
1238 print_glyphs (&font_info);