[HarfBuzz] harfbuzz-ng: Branch 'master'
Behdad Esfahbod
behdad at kemper.freedesktop.org
Tue May 31 09:59:33 PDT 2011
src/hb-view.cc | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
New commits:
commit 0c6a9767c812c00f2a6a02d9f43f4694e1f43815
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Tue May 31 12:59:17 2011 -0400
[hb-view] Add --face-index to choose a face in a TrueType Collection
diff --git a/src/hb-view.cc b/src/hb-view.cc
index 519f6cf..104d95c 100644
--- a/src/hb-view.cc
+++ b/src/hb-view.cc
@@ -51,6 +51,7 @@ static int margin_b = 10;
static int margin_l = 10;
static int margin_r = 10;
static int line_space = 0;
+static int face_index = 0;
static double font_size = 18;
static const char *fore = "#000000";
static const char *back = "#ffffff";
@@ -106,6 +107,7 @@ parse_opts (int argc, char **argv)
{"direction", 1, 0, 'd'},
{"features", 1, 0, 'f'},
{"font-size", 1, 0, 's'},
+ {"face-index", 1, 0, 'i'},
{"foreground", 1, 0, 'F'},
{"help", 0, 0, 'h'},
{"language", 1, 0, 'L'},
@@ -131,6 +133,9 @@ parse_opts (int argc, char **argv)
case 'v':
version ();
break;
+ case 'i':
+ face_index = atoi (optarg);
+ break;
case 'l':
line_space = atoi (optarg);
break;
@@ -528,7 +533,7 @@ main (int argc, char **argv)
parse_opts (argc, argv);
FT_Init_FreeType (&ft_library);
- if (FT_New_Face (ft_library, font_file, 0, &ft_face)) {
+ if (FT_New_Face (ft_library, font_file, face_index, &ft_face)) {
fprintf (stderr, "Failed to open font file `%s'\n", font_file);
exit (1);
}
More information about the HarfBuzz
mailing list