/*
- * Copyright (C) 2007,2008,2009 Red Hat, Inc.
+ * Copyright © 2007,2008,2009 Red Hat, Inc.
*
* This is part of HarfBuzz, a text shaping library.
*
#include <stdlib.h>
#include <stdio.h>
+HB_BEGIN_DECLS
+
+
int
main (int argc, char **argv)
{
printf ("Opened font file %s: %d bytes long\n", argv[1], len);
- const OpenTypeFontFile &ot = OpenTypeFontFile::get_for_data (font_data);
+ const OpenTypeFontFile &ot = *CastP<OpenTypeFontFile> (font_data);
switch (ot.get_tag ()) {
case OpenTypeFontFile::TrueTypeTag:
case OpenTypeFontFile::TTCTag:
printf ("TrueType Collection of OpenType fonts\n");
break;
+ case OpenTypeFontFile::TrueTag:
+ printf ("Obsolete Apple TrueType font\n");
+ break;
+ case OpenTypeFontFile::Typ1Tag:
+ printf ("Obsolete Apple Type1 font in SFNT container\n");
+ break;
default:
printf ("Unknown font format\n");
break;
case GSUBGPOS::GPOSTag:
{
- const GSUBGPOS &g = GSUBGPOS::get_for_data ((const char *) &ot + table.offset);
+ const GSUBGPOS &g = *CastP<GSUBGPOS> (font_data + table.offset);
int num_scripts = g.get_script_count ();
printf (" %d script(s) found in table\n", num_scripts);
? " Default Language System\n"
: " Language System %2d of %2d: %.4s\n", n_langsys, num_langsys,
(const char *)script.get_lang_sys_tag (n_langsys));
- if (langsys.get_required_feature_index () == NO_INDEX)
+ if (langsys.get_required_feature_index () == Index::NOT_FOUND_INDEX)
printf (" No required feature\n");
int num_features = langsys.get_feature_count ();
printf (" %d lookup(s) found in table\n", num_lookups);
for (int n_lookup = 0; n_lookup < num_lookups; n_lookup++) {
const Lookup &lookup = g.get_lookup (n_lookup);
- printf (" Lookup %2d of %2d: type %d, flags 0x%04X\n", n_lookup, num_lookups,
- lookup.get_type(), lookup.get_flag());
+ printf (" Lookup %2d of %2d: type %d, props 0x%04X\n", n_lookup, num_lookups,
+ lookup.get_type(), lookup.get_props());
}
}
case GDEF::Tag:
{
- const GDEF &gdef = GDEF::get_for_data ((const char *) &ot + table.offset);
+ const GDEF &gdef = *CastP<GDEF> (font_data + table.offset);
printf (" Has %sglyph classes\n",
gdef.has_glyph_classes () ? "" : "no ");
return 0;
}
+
+
+HB_END_DECLS