├── .gitignore ├── README.md ├── cpp ├── CMakeLists.txt ├── COPYING.txt ├── data │ ├── ext │ │ ├── AnonymousPro-Regular.ttf │ │ └── Tuffy.ttf │ └── fonts │ │ ├── abel │ │ ├── Abel-Regular.ttf │ │ ├── Abel-Regular.ttf.xml │ │ └── OFL.txt │ │ ├── abrilfatface │ │ ├── AbrilFatface-Regular.ttf │ │ ├── AbrilFatface-Regular.ttf.xml │ │ └── OFL.txt │ │ ├── aclonica │ │ ├── Aclonica.ttf │ │ └── Aclonica.ttf.xml │ │ ├── actor │ │ ├── Actor-Regular.ttf │ │ ├── Actor-Regular.ttf.xml │ │ └── OFL.txt │ │ ├── adamina │ │ ├── Adamina-Regular.ttf │ │ ├── Adamina-Regular.ttf.xml │ │ └── OFL.txt │ │ ├── aldrich │ │ ├── Aldrich-Regular.ttf │ │ ├── Aldrich-Regular.ttf.xml │ │ └── OFL.txt │ │ ├── alice │ │ ├── Alice-Regular.ttf │ │ ├── Alice-Regular.ttf.xml │ │ └── OFL.txt │ │ ├── alike │ │ ├── Alike-Regular.ttf │ │ ├── Alike-Regular.ttf.xml │ │ └── OFL.txt │ │ ├── allan │ │ ├── Allan-Bold.ttf │ │ ├── Allan-Bold.ttf.xml │ │ └── OFL.txt │ │ ├── allerta │ │ ├── Allerta-Medium.ttf │ │ ├── Allerta-Medium.ttf.xml │ │ ├── Allerta-Stencil.ttf │ │ ├── Allerta-Stencil.ttf.xml │ │ └── OFL.txt │ │ ├── amaranth │ │ ├── Amaranth-Bold.ttf │ │ ├── Amaranth-Bold.ttf.xml │ │ ├── Amaranth-BoldItalic.ttf │ │ ├── Amaranth-BoldItalic.ttf.xml │ │ ├── Amaranth-Italic.ttf │ │ ├── Amaranth-Italic.ttf.xml │ │ ├── Amaranth-Regular.ttf │ │ ├── Amaranth-Regular.ttf.xml │ │ └── OFL.txt │ │ ├── amaticsc │ │ ├── AmaticSC-Bold.ttf │ │ ├── AmaticSC-Bold.ttf.xml │ │ ├── AmaticSC-Regular.ttf │ │ ├── AmaticSC-Regular.ttf.xml │ │ └── OFL.txt │ │ ├── andika │ │ ├── Andika-R.ttf │ │ ├── Andika-R.ttf.xml │ │ └── OFL.txt │ │ ├── angkor │ │ ├── Angkor.ttf │ │ ├── Angkor.ttf.xml │ │ └── OFL.txt │ │ ├── annieuseyourtelescope │ │ ├── AnnieUseYourTelescope.ttf │ │ ├── AnnieUseYourTelescope.ttf.xml │ │ └── OFL.txt │ │ ├── anonymouspro │ │ ├── AnonymousPro-Bold.ttf │ │ ├── AnonymousPro-Bold.ttf.xml │ │ ├── AnonymousPro-BoldItalic.ttf │ │ ├── AnonymousPro-BoldItalic.ttf.xml │ │ ├── AnonymousPro-Italic.ttf │ │ ├── AnonymousPro-Italic.ttf.xml │ │ ├── AnonymousPro-Regular.ttf │ │ ├── AnonymousPro-Regular.ttf.xml │ │ └── OFL.txt │ │ ├── antic │ │ ├── Antic-Regular.ttf │ │ ├── Antic-Regular.ttf.xml │ │ └── OFL.txt │ │ ├── anton │ │ ├── Anton.ttf │ │ ├── Anton.ttf.xml │ │ └── OFL.txt │ │ ├── architectsdaughter │ │ ├── ArchitectsDaughter.ttf │ │ ├── ArchitectsDaughter.ttf.xml │ │ └── OFL.txt │ │ ├── arimo │ │ ├── Arimo-Bold.ttf │ │ ├── Arimo-Bold.ttf.xml │ │ ├── Arimo-BoldItalic.ttf │ │ ├── Arimo-BoldItalic.ttf.xml │ │ ├── Arimo-Italic.ttf │ │ ├── Arimo-Italic.ttf.xml │ │ ├── Arimo-Regular.ttf │ │ ├── Arimo-Regular.ttf.xml │ │ └── OFL.txt │ │ ├── artifika │ │ ├── Artifika-Regular.ttf │ │ ├── Artifika-Regular.ttf.xml │ │ └── OFL.txt │ │ ├── arvo │ │ ├── Arvo-Bold.ttf │ │ ├── Arvo-Bold.ttf.xml │ │ ├── Arvo-BoldItalic.ttf │ │ ├── Arvo-BoldItalic.ttf.xml │ │ ├── Arvo-Italic.ttf │ │ ├── Arvo-Italic.ttf.xml │ │ ├── Arvo-Regular.ttf │ │ ├── Arvo-Regular.ttf.xml │ │ └── OFL.txt │ │ ├── asset │ │ ├── Asset.ttf │ │ ├── Asset.ttf.xml │ │ └── OFL.txt │ │ ├── astloch │ │ ├── Astloch-Bold.ttf │ │ ├── Astloch-Bold.ttf.xml │ │ ├── Astloch-Regular.ttf │ │ ├── Astloch-Regular.ttf.xml │ │ └── OFL.txt │ │ ├── aubrey │ │ ├── Aubrey-Regular.ttf │ │ ├── Aubrey-Regular.ttf.xml │ │ └── OFL.txt │ │ ├── bangers │ │ ├── Bangers.ttf │ │ ├── Bangers.ttf.xml │ │ └── OFL.txt │ │ ├── battambang │ │ ├── Battambang-Bold.ttf │ │ ├── Battambang-Bold.ttf.xml │ │ ├── Battambang-Regular.ttf │ │ ├── Battambang-Regular.ttf.xml │ │ └── OFL.txt │ │ ├── bayon │ │ ├── Bayon.ttf │ │ ├── Bayon.ttf.xml │ │ └── OFL.txt │ │ ├── bentham │ │ ├── Bentham-Regular.ttf │ │ ├── Bentham-Regular.ttf.xml │ │ └── OFL.txt │ │ ├── bevan │ │ ├── Bevan.ttf │ │ ├── Bevan.ttf.xml │ │ └── OFL.txt │ │ ├── bigshotone │ │ ├── BigshotOne.ttf │ │ ├── BigshotOne.ttf.xml │ │ └── OFL.txt │ │ ├── blackopsone │ │ ├── BlackOpsOne.ttf │ │ ├── BlackOpsOne.ttf.xml │ │ └── OFL.txt │ │ ├── bokor │ │ ├── Bokor.ttf │ │ ├── Bokor.ttf.xml │ │ └── OFL.txt │ │ ├── bowlbyone │ │ ├── BowlbyOne.ttf │ │ ├── BowlbyOne.ttf.xml │ │ ├── BowlbyOneSC.ttf │ │ ├── BowlbyOneSC.ttf.xml │ │ └── OFL.txt │ │ ├── brawler │ │ ├── Brawler-Regular.ttf │ │ ├── Brawler-Regular.ttf.xml │ │ └── OFL.txt │ │ ├── buda │ │ ├── Buda-Light.ttf │ │ ├── Buda-Light.ttf.xml │ │ └── OFL.txt │ │ ├── cabin │ │ ├── Cabin-Bold.ttf │ │ ├── Cabin-Bold.ttf.xml │ │ ├── Cabin-BoldItalic.ttf │ │ ├── Cabin-BoldItalic.ttf.xml │ │ ├── Cabin-Italic.ttf │ │ ├── Cabin-Italic.ttf.xml │ │ ├── Cabin-Medium.ttf │ │ ├── Cabin-Medium.ttf.xml │ │ ├── Cabin-MediumItalic.ttf │ │ ├── Cabin-MediumItalic.ttf.xml │ │ ├── Cabin-Regular.ttf │ │ ├── Cabin-Regular.ttf.xml │ │ ├── Cabin-SemiBold.ttf │ │ ├── Cabin-SemiBold.ttf.xml │ │ ├── Cabin-SemiBoldItalic.ttf │ │ ├── Cabin-SemiBoldItalic.ttf.xml │ │ └── OFL.txt │ │ ├── cabinsketch │ │ ├── CabinSketch-Bold.ttf │ │ ├── CabinSketch-Bold.ttf.xml │ │ └── OFL.txt │ │ ├── calligraffiti │ │ ├── Calligraffiti.ttf │ │ └── Calligraffiti.ttf.xml │ │ ├── candal │ │ ├── Candal.ttf │ │ ├── Candal.ttf.xml │ │ └── OFL.txt │ │ ├── cantarell │ │ ├── Cantarell-Bold.ttf │ │ ├── Cantarell-Bold.ttf.xml │ │ ├── Cantarell-BoldOblique.ttf │ │ ├── Cantarell-BoldOblique.ttf.xml │ │ ├── Cantarell-Oblique.ttf │ │ ├── Cantarell-Oblique.ttf.xml │ │ ├── Cantarell-Regular.ttf │ │ ├── Cantarell-Regular.ttf.xml │ │ └── OFL.txt │ │ ├── cardo │ │ ├── Cardo-Bold.ttf │ │ ├── Cardo-Bold.ttf.xml │ │ ├── Cardo-Italic.ttf │ │ ├── Cardo-Italic.ttf.xml │ │ ├── Cardo-Regular.ttf │ │ ├── Cardo-Regular.ttf.xml │ │ └── OFL.txt │ │ ├── carme │ │ ├── Carme-Regular.ttf │ │ ├── Carme-Regular.ttf.xml │ │ └── OFL.txt │ │ ├── carterone │ │ ├── CarterOne.ttf │ │ ├── CarterOne.ttf.xml │ │ └── OFL.txt │ │ ├── caudex │ │ ├── Caudex-Bold.ttf │ │ ├── Caudex-Bold.ttf.xml │ │ ├── Caudex-BoldItalic.ttf │ │ ├── Caudex-BoldItalic.ttf.xml │ │ ├── Caudex-Italic.ttf │ │ ├── Caudex-Italic.ttf.xml │ │ ├── Caudex-Regular.ttf │ │ ├── Caudex-Regular.ttf.xml │ │ └── OFL.txt │ │ ├── cedarvillecursive │ │ ├── Cedarville-Cursive.ttf │ │ ├── Cedarville-Cursive.ttf.xml │ │ └── OFL.txt │ │ ├── changaone │ │ ├── ChangaOne-Regular.ttf │ │ ├── ChangaOne-Regular.ttf.xml │ │ └── OFL.txt │ │ ├── chenla │ │ ├── Chenla.ttf │ │ ├── Chenla.ttf.xml │ │ └── OFL.txt │ │ ├── cherrycreamsoda │ │ ├── CherryCreamSoda.ttf │ │ └── CherryCreamSoda.ttf.xml │ │ ├── chewy │ │ ├── Chewy.ttf │ │ └── Chewy.ttf.xml │ │ ├── coda │ │ ├── Coda-Caption-Heavy.ttf │ │ ├── Coda-Caption-Heavy.ttf.xml │ │ ├── Coda-Heavy.ttf │ │ ├── Coda-Heavy.ttf.xml │ │ └── OFL.txt │ │ ├── comfortaa │ │ ├── Comfortaa-Bold.ttf │ │ ├── Comfortaa-Bold.ttf.xml │ │ ├── Comfortaa-Light.ttf │ │ ├── Comfortaa-Light.ttf.xml │ │ ├── Comfortaa-Regular.ttf │ │ ├── Comfortaa-Regular.ttf.xml │ │ └── OFL.txt │ │ ├── comingsoon │ │ ├── ComingSoon.ttf │ │ └── ComingSoon.ttf.xml │ │ ├── content │ │ ├── Content-Bold.ttf │ │ ├── Content-Bold.ttf.xml │ │ ├── Content-Regular.ttf │ │ ├── Content-Regular.ttf.xml │ │ └── OFL.txt │ │ ├── contrail │ │ ├── Contrail-Regular.ttf │ │ ├── Contrail-Regular.ttf.xml │ │ └── OFL.txt │ │ ├── copse │ │ ├── Copse-Regular.ttf │ │ ├── Copse-Regular.ttf.xml │ │ └── OFL.txt │ │ ├── corben │ │ ├── Corben-Bold.ttf │ │ ├── Corben-Bold.ttf.xml │ │ └── OFL.txt │ │ ├── cousine │ │ ├── Cousine-Bold.ttf │ │ ├── Cousine-Bold.ttf.xml │ │ ├── Cousine-BoldItalic.ttf │ │ ├── Cousine-BoldItalic.ttf.xml │ │ ├── Cousine-Italic.ttf │ │ ├── Cousine-Italic.ttf.xml │ │ ├── Cousine-Regular.ttf │ │ ├── Cousine-Regular.ttf.xml │ │ └── OFL.txt │ │ ├── coustard │ │ ├── Coustard-Black.ttf │ │ ├── Coustard-Black.ttf.xml │ │ ├── Coustard-Regular.ttf │ │ ├── Coustard-Regular.ttf.xml │ │ └── OFL.txt │ │ ├── coveredbyyourgrace │ │ ├── CoveredByYourGrace.ttf │ │ ├── CoveredByYourGrace.ttf.xml │ │ └── OFL.txt │ │ ├── craftygirls │ │ ├── CraftyGirls.ttf │ │ └── CraftyGirls.ttf.xml │ │ ├── crimson │ │ ├── CrimsonText-Bold.ttf │ │ ├── CrimsonText-Bold.ttf.xml │ │ ├── CrimsonText-BoldItalic.ttf │ │ ├── CrimsonText-BoldItalic.ttf.xml │ │ ├── CrimsonText-Italic.ttf │ │ ├── CrimsonText-Italic.ttf.xml │ │ ├── CrimsonText-Roman.ttf │ │ ├── CrimsonText-Roman.ttf.xml │ │ ├── CrimsonText-Semibold.ttf │ │ ├── CrimsonText-Semibold.ttf.xml │ │ ├── CrimsonText-SemiboldItalic.ttf │ │ ├── CrimsonText-SemiboldItalic.ttf.xml │ │ └── OFL.txt │ │ ├── crushed │ │ ├── Crushed.ttf │ │ └── Crushed.ttf.xml │ │ ├── cuprum │ │ ├── Cuprum.ttf │ │ ├── Cuprum.ttf.xml │ │ └── OFL.txt │ │ ├── damion │ │ ├── Damion-Regular.ttf │ │ ├── Damion-Regular.ttf.xml │ │ └── OFL.txt │ │ ├── dancingscript │ │ ├── DancingScript-Bold.ttf │ │ ├── DancingScript-Bold.ttf.xml │ │ ├── DancingScript-Regular.ttf │ │ ├── DancingScript-Regular.ttf.xml │ │ └── OFL.txt │ │ ├── dangrek │ │ ├── Dangrek.ttf │ │ ├── Dangrek.ttf.xml │ │ └── OFL.txt │ │ ├── dawningofanewday │ │ ├── DawningofaNewDay.ttf │ │ ├── DawningofaNewDay.ttf.xml │ │ └── OFL.txt │ │ ├── daysone │ │ ├── DaysOne-Regular.ttf │ │ ├── DaysOne-Regular.ttf.xml │ │ └── OFL.txt │ │ ├── delius │ │ ├── Delius-Regular.ttf │ │ ├── Delius-Regular.ttf.xml │ │ └── OFL.txt │ │ ├── deliusswashcaps │ │ ├── DeliusSwashCaps-Regular.ttf │ │ ├── DeliusSwashCaps-Regular.ttf.xml │ │ └── OFL.txt │ │ ├── deliusunicase │ │ ├── DeliusUnicase-Regular.ttf │ │ ├── DeliusUnicase-Regular.ttf.xml │ │ └── OFL.txt │ │ ├── didactgothic │ │ ├── DidactGothic.ttf │ │ ├── DidactGothic.ttf.xml │ │ └── OFL.txt │ │ ├── dorsa │ │ ├── Dorsa-Regular.ttf │ │ ├── Dorsa-Regular.ttf.xml │ │ └── OFL.txt │ │ ├── ebgaramond │ │ ├── EBGaramond-Regular.ttf │ │ ├── EBGaramond-Regular.ttf.xml │ │ └── OFL.txt │ │ ├── expletussans │ │ ├── ExpletusSans-Bold.ttf │ │ ├── ExpletusSans-Bold.ttf.xml │ │ ├── ExpletusSans-BoldItalic.ttf │ │ ├── ExpletusSans-BoldItalic.ttf.xml │ │ ├── ExpletusSans-Italic.ttf │ │ ├── ExpletusSans-Italic.ttf.xml │ │ ├── ExpletusSans-Medium.ttf │ │ ├── ExpletusSans-Medium.ttf.xml │ │ ├── ExpletusSans-MediumItalic.ttf │ │ ├── ExpletusSans-MediumItalic.ttf.xml │ │ ├── ExpletusSans-Regular.ttf │ │ ├── ExpletusSans-Regular.ttf.xml │ │ ├── ExpletusSans-SemiBold.ttf │ │ ├── ExpletusSans-SemiBold.ttf.xml │ │ ├── ExpletusSans-SemiBoldItalic.ttf │ │ ├── ExpletusSans-SemiBoldItalic.ttf.xml │ │ └── OFL.txt │ │ ├── fanwoodtext │ │ ├── FanwoodText-Italic.ttf │ │ ├── FanwoodText-Italic.ttf.xml │ │ ├── FanwoodText-Regular.ttf │ │ ├── FanwoodText-Regular.ttf.xml │ │ └── OFL.txt │ │ ├── federo │ │ ├── Federo-Regular.ttf │ │ ├── Federo-Regular.ttf.xml │ │ └── OFL.txt │ │ ├── felltypes │ │ ├── IMFeDPit28P.ttf │ │ ├── IMFeDPit28P.ttf.xml │ │ ├── IMFeDPrm28P.ttf │ │ ├── IMFeDPrm28P.ttf.xml │ │ ├── IMFeDPsc28P.ttf │ │ ├── IMFeDPsc28P.ttf.xml │ │ ├── IMFeENit28P.ttf │ │ ├── IMFeENit28P.ttf.xml │ │ ├── IMFeENrm28P.ttf │ │ ├── IMFeENrm28P.ttf.xml │ │ ├── IMFeENsc28P.ttf │ │ ├── IMFeENsc28P.ttf.xml │ │ ├── IMFeFCit28P.ttf │ │ ├── IMFeFCit28P.ttf.xml │ │ ├── IMFeFCrm28P.ttf │ │ ├── IMFeFCrm28P.ttf.xml │ │ ├── IMFeFCsc28P.ttf │ │ ├── IMFeFCsc28P.ttf.xml │ │ ├── IMFeGPit28P.ttf │ │ ├── IMFeGPit28P.ttf.xml │ │ ├── IMFeGPrm28P.ttf │ │ ├── IMFeGPrm28P.ttf.xml │ │ ├── IMFeGPsc28P.ttf │ │ ├── IMFeGPsc28P.ttf.xml │ │ ├── IMFePIit28P.ttf │ │ ├── IMFePIit28P.ttf.xml │ │ ├── IMFePIrm28P.ttf │ │ ├── IMFePIrm28P.ttf.xml │ │ ├── IMFePIsc28P.ttf │ │ ├── IMFePIsc28P.ttf.xml │ │ └── OFL.txt │ │ ├── forum │ │ ├── Forum-Regular.ttf │ │ ├── Forum-Regular.ttf.xml │ │ └── OFL.txt │ │ ├── francoisone │ │ ├── FrancoisOne.ttf │ │ ├── FrancoisOne.ttf.xml │ │ └── OFL.txt │ │ └── freehand │ │ ├── Freehand.ttf │ │ ├── Freehand.ttf.xml │ │ └── OFL.txt ├── ext │ ├── .gitignore │ └── redist │ │ ├── cmake-2.8.5-win32-x86.zip │ │ ├── gtest-1.6.0.zip │ │ └── icu4c-4_6_1-Win32-msvc10.zip ├── src │ ├── sample │ │ ├── chromium │ │ │ ├── chrome_subsetter.cc │ │ │ ├── font_subsetter.cc │ │ │ ├── font_subsetter.h │ │ │ ├── subsetter_impl.cc │ │ │ └── subsetter_impl.h │ │ ├── subsetter │ │ │ ├── main.cc │ │ │ ├── subset_util.cc │ │ │ └── subset_util.h │ │ └── subtly │ │ │ ├── character_predicate.cc │ │ │ ├── character_predicate.h │ │ │ ├── debug_main.cc │ │ │ ├── font_assembler.cc │ │ │ ├── font_assembler.h │ │ │ ├── font_info.cc │ │ │ ├── font_info.h │ │ │ ├── merger.cc │ │ │ ├── merger.h │ │ │ ├── merger_main.cc │ │ │ ├── stats.cc │ │ │ ├── stats.h │ │ │ ├── subsetter.cc │ │ │ ├── subsetter.h │ │ │ ├── subsetter_main.cc │ │ │ ├── utils.cc │ │ │ └── utils.h │ ├── sfntly │ │ ├── data │ │ │ ├── byte_array.cc │ │ │ ├── byte_array.h │ │ │ ├── font_data.cc │ │ │ ├── font_data.h │ │ │ ├── font_input_stream.cc │ │ │ ├── font_input_stream.h │ │ │ ├── font_output_stream.cc │ │ │ ├── font_output_stream.h │ │ │ ├── growable_memory_byte_array.cc │ │ │ ├── growable_memory_byte_array.h │ │ │ ├── memory_byte_array.cc │ │ │ ├── memory_byte_array.h │ │ │ ├── readable_font_data.cc │ │ │ ├── readable_font_data.h │ │ │ ├── writable_font_data.cc │ │ │ └── writable_font_data.h │ │ ├── font.cc │ │ ├── font.h │ │ ├── font_factory.cc │ │ ├── font_factory.h │ │ ├── math │ │ │ ├── fixed1616.h │ │ │ └── font_math.h │ │ ├── port │ │ │ ├── atomic.h │ │ │ ├── config.h │ │ │ ├── endian.h │ │ │ ├── exception_type.h │ │ │ ├── file_input_stream.cc │ │ │ ├── file_input_stream.h │ │ │ ├── input_stream.h │ │ │ ├── java_iterator.h │ │ │ ├── lock.cc │ │ │ ├── lock.h │ │ │ ├── logging.h │ │ │ ├── memory_input_stream.cc │ │ │ ├── memory_input_stream.h │ │ │ ├── memory_output_stream.cc │ │ │ ├── memory_output_stream.h │ │ │ ├── output_stream.h │ │ │ ├── refcount.h │ │ │ └── type.h │ │ ├── table │ │ │ ├── bitmap │ │ │ │ ├── big_glyph_metrics.cc │ │ │ │ ├── big_glyph_metrics.h │ │ │ │ ├── bitmap_glyph.cc │ │ │ │ ├── bitmap_glyph.h │ │ │ │ ├── bitmap_glyph_info.cc │ │ │ │ ├── bitmap_glyph_info.h │ │ │ │ ├── bitmap_size_table.cc │ │ │ │ ├── bitmap_size_table.h │ │ │ │ ├── composite_bitmap_glyph.cc │ │ │ │ ├── composite_bitmap_glyph.h │ │ │ │ ├── ebdt_table.cc │ │ │ │ ├── ebdt_table.h │ │ │ │ ├── eblc_table.cc │ │ │ │ ├── eblc_table.h │ │ │ │ ├── ebsc_table.cc │ │ │ │ ├── ebsc_table.h │ │ │ │ ├── glyph_metrics.cc │ │ │ │ ├── glyph_metrics.h │ │ │ │ ├── index_sub_table.cc │ │ │ │ ├── index_sub_table.h │ │ │ │ ├── index_sub_table_format1.cc │ │ │ │ ├── index_sub_table_format1.h │ │ │ │ ├── index_sub_table_format2.cc │ │ │ │ ├── index_sub_table_format2.h │ │ │ │ ├── index_sub_table_format3.cc │ │ │ │ ├── index_sub_table_format3.h │ │ │ │ ├── index_sub_table_format4.cc │ │ │ │ ├── index_sub_table_format4.h │ │ │ │ ├── index_sub_table_format5.cc │ │ │ │ ├── index_sub_table_format5.h │ │ │ │ ├── simple_bitmap_glyph.cc │ │ │ │ ├── simple_bitmap_glyph.h │ │ │ │ ├── small_glyph_metrics.cc │ │ │ │ └── small_glyph_metrics.h │ │ │ ├── byte_array_table_builder.cc │ │ │ ├── byte_array_table_builder.h │ │ │ ├── core │ │ │ │ ├── cmap_table.cc │ │ │ │ ├── cmap_table.h │ │ │ │ ├── font_header_table.cc │ │ │ │ ├── font_header_table.h │ │ │ │ ├── horizontal_device_metrics_table.cc │ │ │ │ ├── horizontal_device_metrics_table.h │ │ │ │ ├── horizontal_header_table.cc │ │ │ │ ├── horizontal_header_table.h │ │ │ │ ├── horizontal_metrics_table.cc │ │ │ │ ├── horizontal_metrics_table.h │ │ │ │ ├── maximum_profile_table.cc │ │ │ │ ├── maximum_profile_table.h │ │ │ │ ├── name_table.cc │ │ │ │ ├── name_table.h │ │ │ │ ├── os2_table.cc │ │ │ │ └── os2_table.h │ │ │ ├── font_data_table.cc │ │ │ ├── font_data_table.h │ │ │ ├── generic_table_builder.cc │ │ │ ├── generic_table_builder.h │ │ │ ├── header.cc │ │ │ ├── header.h │ │ │ ├── subtable.cc │ │ │ ├── subtable.h │ │ │ ├── subtable_container_table.h │ │ │ ├── table.cc │ │ │ ├── table.h │ │ │ ├── table_based_table_builder.cc │ │ │ ├── table_based_table_builder.h │ │ │ └── truetype │ │ │ │ ├── glyph_table.cc │ │ │ │ ├── glyph_table.h │ │ │ │ ├── loca_table.cc │ │ │ │ └── loca_table.h │ │ ├── tag.cc │ │ ├── tag.h │ │ └── tools │ │ │ └── subsetter │ │ │ ├── glyph_table_subsetter.cc │ │ │ ├── glyph_table_subsetter.h │ │ │ ├── subsetter.cc │ │ │ ├── subsetter.h │ │ │ ├── table_subsetter.h │ │ │ ├── table_subsetter_impl.cc │ │ │ └── table_subsetter_impl.h │ └── test │ │ ├── autogenerated │ │ ├── cmap_basic_test.cc │ │ └── cmap_test_data.h │ │ ├── bitmap_table_test.cc │ │ ├── byte_array_test.cc │ │ ├── chrome_subsetter.cc │ │ ├── cmap_editing_test.cc │ │ ├── cmap_iterator_test.cc │ │ ├── cmap_test.cc │ │ ├── endian_test.cc │ │ ├── file_io_test.cc │ │ ├── font_data_test.cc │ │ ├── font_parsing_test.cc │ │ ├── hdmx_test.cc │ │ ├── lock_test.cc │ │ ├── memory_io_test.cc │ │ ├── name_editing_test.cc │ │ ├── open_type_data_test.cc │ │ ├── otf_basic_editing_test.cc │ │ ├── platform_thread.cc │ │ ├── platform_thread.h │ │ ├── serialization_test.cc │ │ ├── serialization_test.h │ │ ├── smart_pointer_test.cc │ │ ├── test_data.cc │ │ ├── test_data.h │ │ ├── test_font_utils.cc │ │ ├── test_font_utils.h │ │ ├── test_utils.cc │ │ ├── test_utils.h │ │ ├── test_utils_test.cc │ │ ├── test_xml_utils.cc │ │ ├── test_xml_utils.h │ │ ├── tinyxml │ │ ├── tinystr.cpp │ │ ├── tinystr.h │ │ ├── tinyxml.cpp │ │ ├── tinyxml.h │ │ ├── tinyxmlerror.cpp │ │ └── tinyxmlparser.cpp │ │ ├── verify_glyf.cc │ │ ├── verify_hhea.cc │ │ ├── verify_hmtx.cc │ │ ├── verify_loca.cc │ │ ├── verify_maxp.cc │ │ ├── verify_name.cc │ │ └── verify_os2.cc └── tools │ ├── README-test_data.txt │ ├── README_xml.txt │ ├── clean_fonts_repo.py │ ├── cmap_data_generator_xml.py │ ├── font_data_generator_xml.py │ ├── generate_font_data_xml.py │ ├── generate_font_list_cc.py │ ├── test_data_generator_xml.py │ └── utils.py ├── data └── testdata │ ├── DroidSans-Regular.ttf │ ├── OpenSans-Regular.ttf │ └── Roboto-Regular.ttf ├── doc ├── MicroTypeExpress.md ├── SfntlyCPlusPlusNotes.md ├── Useful_links.md ├── build_cpp.md ├── smart_pointer_usage.md └── unit_tests.md └── java ├── COPYING ├── pom.xml ├── src └── com │ └── google │ └── typography │ └── font │ ├── sfntly │ ├── Font.java │ ├── FontFactory.java │ ├── Tag.java │ ├── data │ │ ├── ByteArray.java │ │ ├── FontData.java │ │ ├── FontInputStream.java │ │ ├── FontOutputStream.java │ │ ├── GrowableMemoryByteArray.java │ │ ├── MemoryByteArray.java │ │ ├── ReadableFontData.java │ │ ├── SegmentedGrowableMemoryByteArray.java │ │ ├── SfObjects.java │ │ ├── SfStringUtils.java │ │ └── WritableFontData.java │ ├── math │ │ ├── Fixed1616.java │ │ └── FontMath.java │ ├── sample │ │ ├── build.properties │ │ ├── build.xml │ │ ├── sflint │ │ │ └── SFLint.java │ │ ├── sfntdump │ │ │ └── SfntDump.java │ │ └── sfview │ │ │ ├── GsubRulesDump.java │ │ │ ├── HtmlViewer.java │ │ │ ├── OtTableTagger.java │ │ │ ├── RuleDump.java │ │ │ ├── SFFontView.java │ │ │ ├── SFView.java │ │ │ ├── TaggedData.java │ │ │ ├── ViewableTaggedData.java │ │ │ └── package-info.java │ └── table │ │ ├── ByteArrayTableBuilder.java │ │ ├── FontDataTable.java │ │ ├── GenericTableBuilder.java │ │ ├── Header.java │ │ ├── SubTable.java │ │ ├── SubTableContainerTable.java │ │ ├── Table.java │ │ ├── TableBasedTableBuilder.java │ │ ├── bitmap │ │ ├── BigGlyphMetrics.java │ │ ├── BitmapGlyph.java │ │ ├── BitmapGlyphInfo.java │ │ ├── BitmapSizeTable.java │ │ ├── CompositeBitmapGlyph.java │ │ ├── EbdtTable.java │ │ ├── EblcTable.java │ │ ├── EbscTable.java │ │ ├── GlyphMetrics.java │ │ ├── IndexSubTable.java │ │ ├── IndexSubTableFormat1.java │ │ ├── IndexSubTableFormat2.java │ │ ├── IndexSubTableFormat3.java │ │ ├── IndexSubTableFormat4.java │ │ ├── IndexSubTableFormat5.java │ │ ├── SbitLineMetrics.java │ │ ├── SimpleBitmapGlyph.java │ │ └── SmallGlyphMetrics.java │ │ ├── core │ │ ├── CMap.java │ │ ├── CMapFormat0.java │ │ ├── CMapFormat10.java │ │ ├── CMapFormat12.java │ │ ├── CMapFormat13.java │ │ ├── CMapFormat14.java │ │ ├── CMapFormat2.java │ │ ├── CMapFormat4.java │ │ ├── CMapFormat6.java │ │ ├── CMapFormat8.java │ │ ├── CMapTable.java │ │ ├── FontHeaderTable.java │ │ ├── HorizontalDeviceMetricsTable.java │ │ ├── HorizontalHeaderTable.java │ │ ├── HorizontalMetricsTable.java │ │ ├── MaximumProfileTable.java │ │ ├── NameTable.java │ │ ├── OS2Table.java │ │ └── PostScriptTable.java │ │ ├── opentype │ │ ├── AlternateSubst.java │ │ ├── ChainContextSubst.java │ │ ├── ClassDefTable.java │ │ ├── ContextSubst.java │ │ ├── CoverageTable.java │ │ ├── ExtensionSubst.java │ │ ├── FeatureListTable.java │ │ ├── FeatureTable.java │ │ ├── FeatureTag.java │ │ ├── GSubTable.java │ │ ├── GsubCommonTable.java │ │ ├── GsubLookupSubTable.java │ │ ├── GsubLookupTable.java │ │ ├── LangSysTable.java │ │ ├── LanguageTag.java │ │ ├── LayoutCommonTable.java │ │ ├── LigatureSubst.java │ │ ├── LookupList.java │ │ ├── LookupListTable.java │ │ ├── LookupSubTable.java │ │ ├── LookupTable.java │ │ ├── MultipleSubst.java │ │ ├── NullTable.java │ │ ├── OTSubTable.java │ │ ├── ReverseChainSingleSubst.java │ │ ├── ScriptListTable.java │ │ ├── ScriptTable.java │ │ ├── ScriptTag.java │ │ ├── SingleSubst.java │ │ ├── SubstSubtable.java │ │ ├── TaggedData.java │ │ ├── chaincontextsubst │ │ │ ├── ChainSubClassRule.java │ │ │ ├── ChainSubClassSet.java │ │ │ ├── ChainSubClassSetArray.java │ │ │ ├── ChainSubGenericRule.java │ │ │ ├── ChainSubGenericRuleSet.java │ │ │ ├── ChainSubRule.java │ │ │ ├── ChainSubRuleSet.java │ │ │ ├── ChainSubRuleSetArray.java │ │ │ ├── CoverageArray.java │ │ │ └── InnerArraysFmt3.java │ │ ├── classdef │ │ │ └── InnerArrayFmt1.java │ │ ├── component │ │ │ ├── GlyphClassList.java │ │ │ ├── GlyphGroup.java │ │ │ ├── GlyphList.java │ │ │ ├── GsubLookupType.java │ │ │ ├── HeaderTable.java │ │ │ ├── LookupFlag.java │ │ │ ├── LookupType.java │ │ │ ├── NumRecord.java │ │ │ ├── NumRecordList.java │ │ │ ├── NumRecordTable.java │ │ │ ├── OffsetRecordTable.java │ │ │ ├── OneToManySubst.java │ │ │ ├── RangeRecord.java │ │ │ ├── RangeRecordList.java │ │ │ ├── RangeRecordTable.java │ │ │ ├── Record.java │ │ │ ├── RecordList.java │ │ │ ├── RecordsTable.java │ │ │ ├── Rule.java │ │ │ ├── RuleExtractor.java │ │ │ ├── RuleSegment.java │ │ │ ├── SubstLookupRecord.java │ │ │ ├── SubstLookupRecordList.java │ │ │ ├── TagOffsetRecord.java │ │ │ ├── TagOffsetRecordList.java │ │ │ ├── TagOffsetsTable.java │ │ │ └── VisibleSubTable.java │ │ ├── contextsubst │ │ │ ├── DoubleRecordTable.java │ │ │ ├── SubClassRule.java │ │ │ ├── SubClassSet.java │ │ │ ├── SubClassSetArray.java │ │ │ ├── SubGenericRuleSet.java │ │ │ ├── SubRule.java │ │ │ ├── SubRuleSet.java │ │ │ └── SubRuleSetArray.java │ │ ├── ligaturesubst │ │ │ ├── InnerArrayFmt1.java │ │ │ ├── Ligature.java │ │ │ └── LigatureSet.java │ │ ├── multiplesubst │ │ │ └── GlyphIds.java │ │ ├── package-info.java │ │ ├── singlesubst │ │ │ ├── HeaderFmt1.java │ │ │ └── InnerArrayFmt2.java │ │ └── testing │ │ │ ├── FontLanguages.java │ │ │ ├── FontLoader.java │ │ │ └── TestLanguagesForFonts.java │ │ └── truetype │ │ ├── CompositeGlyph.java │ │ ├── ControlProgramTable.java │ │ ├── ControlValueTable.java │ │ ├── Glyph.java │ │ ├── GlyphTable.java │ │ ├── LocaTable.java │ │ └── SimpleGlyph.java │ └── tools │ ├── conversion │ ├── build.properties │ ├── build.xml │ ├── eot │ │ ├── BitIOWriter.java │ │ ├── CvtEncoder.java │ │ ├── EOTWriter.java │ │ ├── GlyfEncoder.java │ │ ├── HdmxEncoder.java │ │ ├── HuffmanEncoder.java │ │ ├── LzcompCompress.java │ │ ├── MagnitudeDependentWriter.java │ │ ├── MtxFontBuilder.java │ │ ├── MtxHeadBuilder.java │ │ └── MtxWriter.java │ └── woff │ │ └── WoffWriter.java │ ├── fontinfo │ ├── CommandOptions.java │ ├── DataDisplayTable.java │ ├── FontInfo.java │ ├── FontInfoMain.java │ ├── FontUtils.java │ ├── UnicodeBlockData.java │ ├── build.properties │ └── build.xml │ ├── fontviewer │ ├── AbstractNode.java │ ├── CMapFormat4Node.java │ ├── CmapSegmentNode.java │ ├── ColumnTableModel.java │ ├── FontNode.java │ ├── FontViewer.java │ ├── GlyfTableNode.java │ ├── GlyphNode.java │ ├── GsubRuleNode.java │ ├── GsubRuleSetNode.java │ ├── GsubRuleSetsNode.java │ ├── GsubTableNode.java │ ├── JTableUtils.java │ ├── LocaTableNode.java │ ├── ScriptListTableNode.java │ └── SubTableNode.java │ ├── sfnttool │ ├── GlyphCoverage.java │ ├── SfntTool.java │ ├── build.properties │ └── build.xml │ └── subsetter │ ├── CMapTableBuilder.java │ ├── CMapTableSubsetter.java │ ├── DumbSubsetter.java │ ├── GlyphRenumberer.java │ ├── GlyphStripper.java │ ├── GlyphTableStripper.java │ ├── GlyphTableSubsetter.java │ ├── HintStripper.java │ ├── HorizontalMetricsTableBuilder.java │ ├── HorizontalMetricsTableSubsetter.java │ ├── PostScriptTableBuilder.java │ ├── PostScriptTableSubsetter.java │ ├── RenumberingCMapTableSubsetter.java │ ├── RenumberingSubsetter.java │ ├── Subsetter.java │ ├── TableSubsetter.java │ ├── TableSubsetterImpl.java │ ├── build.properties │ └── build.xml └── test └── com └── google └── typography └── font ├── sfntly ├── CMapEditingTests.java ├── FontTest.java ├── GPosTests.java ├── GlyphEditingTests.java ├── GlyphTests.java ├── HdmxTests.java ├── HheaTests.java ├── LoadingTests.java ├── MetricsTests.java ├── NameEditingTests.java ├── NameTests.java ├── OS2Tests.java ├── OTFBasicEditingTests.java ├── data │ ├── ByteArrayTests.java │ ├── FontDataTests.java │ ├── OpenTypeDataTests.java │ └── SfStringUtilsTest.java ├── issue_tests │ ├── Issue27Tests.java │ └── Issue28Tests.java ├── math │ ├── Fixed1616Test.java │ └── FontMathTest.java ├── table │ ├── bitmap │ │ └── IndexSubTableTest.java │ ├── core │ │ └── CMapCharIteratorsTest.java │ ├── opentype │ │ ├── LanguageTagGenerator.java │ │ ├── LanguageTagTest.java │ │ └── RuleTests.java │ └── truetype │ │ ├── CompositeGlyphTest.java │ │ └── LocaTableTest.java └── testutils │ ├── DebuggingOutputStream.java │ ├── SfAssert.java │ ├── TestFont.java │ ├── TestFontUtils.java │ ├── TestUtils.java │ └── TestUtilsTest.java └── tools ├── conversion └── eot │ ├── BitIOWriterTest.java │ ├── CvtEncoderTest.java │ ├── EOTWriterTest.java │ ├── GlyfEncoderTest.java │ ├── HuffmanEncoderTest.java │ └── MagnitudeDependentWriterTest.java └── subsetter ├── BasicSubsetTests.java ├── CMapTableBuilderTest.java ├── HintStripTest.java ├── HorizontalMetricsTableBuilderTest.java ├── PostScriptTableBuilderTest.java └── RenumberingSubsetTest.java /.gitignore: -------------------------------------------------------------------------------- 1 | # Directories # 2 | java/build/ 3 | java/bin/ 4 | java/target/ 5 | workfiles/ 6 | 7 | # Temps and Backups # 8 | tmp/ 9 | *.tmp 10 | *.bak 11 | *.swp 12 | *~.nib 13 | 14 | # Package Files # 15 | *.jar 16 | *.war 17 | *.ear 18 | *.db 19 | 20 | # Windows 21 | Thumbs.db 22 | Desktop.ini 23 | 24 | # OSX 25 | .DS_Store 26 | 27 | ###################### 28 | # NetBeans 29 | ###################### 30 | ant_nbproject/ 31 | ant_build.xml 32 | nb-configuration.xml 33 | 34 | ###################### 35 | # Eclipse 36 | ###################### 37 | java/.metadata/ 38 | java/.recommenders/ 39 | java/.settings/ 40 | java/.classpath 41 | java/.project 42 | 43 | ###################### 44 | # Java 45 | ###################### 46 | *.class 47 | -------------------------------------------------------------------------------- /cpp/data/ext/AnonymousPro-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/ext/AnonymousPro-Regular.ttf -------------------------------------------------------------------------------- /cpp/data/ext/Tuffy.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/ext/Tuffy.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/abel/Abel-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/abel/Abel-Regular.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/abrilfatface/AbrilFatface-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/abrilfatface/AbrilFatface-Regular.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/aclonica/Aclonica.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/aclonica/Aclonica.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/actor/Actor-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/actor/Actor-Regular.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/adamina/Adamina-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/adamina/Adamina-Regular.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/aldrich/Aldrich-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/aldrich/Aldrich-Regular.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/alice/Alice-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/alice/Alice-Regular.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/alike/Alike-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/alike/Alike-Regular.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/allan/Allan-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/allan/Allan-Bold.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/allerta/Allerta-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/allerta/Allerta-Medium.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/allerta/Allerta-Stencil.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/allerta/Allerta-Stencil.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/amaranth/Amaranth-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/amaranth/Amaranth-Bold.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/amaranth/Amaranth-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/amaranth/Amaranth-BoldItalic.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/amaranth/Amaranth-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/amaranth/Amaranth-Italic.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/amaranth/Amaranth-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/amaranth/Amaranth-Regular.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/amaticsc/AmaticSC-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/amaticsc/AmaticSC-Bold.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/amaticsc/AmaticSC-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/amaticsc/AmaticSC-Regular.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/andika/Andika-R.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/andika/Andika-R.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/angkor/Angkor.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/angkor/Angkor.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/annieuseyourtelescope/AnnieUseYourTelescope.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/annieuseyourtelescope/AnnieUseYourTelescope.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/anonymouspro/AnonymousPro-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/anonymouspro/AnonymousPro-Bold.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/anonymouspro/AnonymousPro-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/anonymouspro/AnonymousPro-BoldItalic.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/anonymouspro/AnonymousPro-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/anonymouspro/AnonymousPro-Italic.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/anonymouspro/AnonymousPro-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/anonymouspro/AnonymousPro-Regular.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/antic/Antic-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/antic/Antic-Regular.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/anton/Anton.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/anton/Anton.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/architectsdaughter/ArchitectsDaughter.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/architectsdaughter/ArchitectsDaughter.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/arimo/Arimo-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/arimo/Arimo-Bold.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/arimo/Arimo-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/arimo/Arimo-BoldItalic.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/arimo/Arimo-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/arimo/Arimo-Italic.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/arimo/Arimo-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/arimo/Arimo-Regular.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/artifika/Artifika-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/artifika/Artifika-Regular.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/arvo/Arvo-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/arvo/Arvo-Bold.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/arvo/Arvo-Bold.ttf.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /cpp/data/fonts/arvo/Arvo-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/arvo/Arvo-BoldItalic.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/arvo/Arvo-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/arvo/Arvo-Italic.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/arvo/Arvo-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/arvo/Arvo-Regular.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/asset/Asset.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/asset/Asset.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/astloch/Astloch-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/astloch/Astloch-Bold.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/astloch/Astloch-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/astloch/Astloch-Regular.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/aubrey/Aubrey-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/aubrey/Aubrey-Regular.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/bangers/Bangers.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/bangers/Bangers.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/battambang/Battambang-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/battambang/Battambang-Bold.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/battambang/Battambang-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/battambang/Battambang-Regular.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/bayon/Bayon.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/bayon/Bayon.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/bentham/Bentham-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/bentham/Bentham-Regular.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/bevan/Bevan.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/bevan/Bevan.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/bigshotone/BigshotOne.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/bigshotone/BigshotOne.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/blackopsone/BlackOpsOne.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/blackopsone/BlackOpsOne.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/bokor/Bokor.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/bokor/Bokor.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/bowlbyone/BowlbyOne.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/bowlbyone/BowlbyOne.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/bowlbyone/BowlbyOneSC.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/bowlbyone/BowlbyOneSC.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/brawler/Brawler-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/brawler/Brawler-Regular.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/buda/Buda-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/buda/Buda-Light.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/cabin/Cabin-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/cabin/Cabin-Bold.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/cabin/Cabin-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/cabin/Cabin-BoldItalic.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/cabin/Cabin-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/cabin/Cabin-Italic.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/cabin/Cabin-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/cabin/Cabin-Medium.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/cabin/Cabin-MediumItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/cabin/Cabin-MediumItalic.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/cabin/Cabin-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/cabin/Cabin-Regular.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/cabin/Cabin-SemiBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/cabin/Cabin-SemiBold.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/cabin/Cabin-SemiBoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/cabin/Cabin-SemiBoldItalic.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/cabinsketch/CabinSketch-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/cabinsketch/CabinSketch-Bold.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/calligraffiti/Calligraffiti.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/calligraffiti/Calligraffiti.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/candal/Candal.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/candal/Candal.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/cantarell/Cantarell-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/cantarell/Cantarell-Bold.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/cantarell/Cantarell-BoldOblique.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/cantarell/Cantarell-BoldOblique.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/cantarell/Cantarell-Oblique.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/cantarell/Cantarell-Oblique.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/cantarell/Cantarell-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/cantarell/Cantarell-Regular.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/cardo/Cardo-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/cardo/Cardo-Bold.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/cardo/Cardo-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/cardo/Cardo-Italic.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/cardo/Cardo-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/cardo/Cardo-Regular.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/carme/Carme-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/carme/Carme-Regular.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/carterone/CarterOne.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/carterone/CarterOne.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/caudex/Caudex-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/caudex/Caudex-Bold.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/caudex/Caudex-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/caudex/Caudex-BoldItalic.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/caudex/Caudex-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/caudex/Caudex-Italic.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/caudex/Caudex-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/caudex/Caudex-Regular.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/cedarvillecursive/Cedarville-Cursive.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/cedarvillecursive/Cedarville-Cursive.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/changaone/ChangaOne-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/changaone/ChangaOne-Regular.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/chenla/Chenla.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/chenla/Chenla.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/cherrycreamsoda/CherryCreamSoda.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/cherrycreamsoda/CherryCreamSoda.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/chewy/Chewy.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/chewy/Chewy.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/coda/Coda-Caption-Heavy.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/coda/Coda-Caption-Heavy.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/coda/Coda-Heavy.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/coda/Coda-Heavy.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/comfortaa/Comfortaa-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/comfortaa/Comfortaa-Bold.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/comfortaa/Comfortaa-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/comfortaa/Comfortaa-Light.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/comfortaa/Comfortaa-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/comfortaa/Comfortaa-Regular.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/comingsoon/ComingSoon.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/comingsoon/ComingSoon.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/content/Content-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/content/Content-Bold.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/content/Content-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/content/Content-Regular.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/contrail/Contrail-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/contrail/Contrail-Regular.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/contrail/Contrail-Regular.ttf.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /cpp/data/fonts/copse/Copse-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/copse/Copse-Regular.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/corben/Corben-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/corben/Corben-Bold.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/corben/Corben-Bold.ttf.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /cpp/data/fonts/cousine/Cousine-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/cousine/Cousine-Bold.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/cousine/Cousine-Bold.ttf.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /cpp/data/fonts/cousine/Cousine-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/cousine/Cousine-BoldItalic.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/cousine/Cousine-BoldItalic.ttf.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /cpp/data/fonts/cousine/Cousine-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/cousine/Cousine-Italic.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/cousine/Cousine-Italic.ttf.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /cpp/data/fonts/cousine/Cousine-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/cousine/Cousine-Regular.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/cousine/Cousine-Regular.ttf.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /cpp/data/fonts/coustard/Coustard-Black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/coustard/Coustard-Black.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/coustard/Coustard-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/coustard/Coustard-Regular.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/coveredbyyourgrace/CoveredByYourGrace.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/coveredbyyourgrace/CoveredByYourGrace.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/craftygirls/CraftyGirls.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/craftygirls/CraftyGirls.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/crimson/CrimsonText-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/crimson/CrimsonText-Bold.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/crimson/CrimsonText-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/crimson/CrimsonText-BoldItalic.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/crimson/CrimsonText-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/crimson/CrimsonText-Italic.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/crimson/CrimsonText-Roman.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/crimson/CrimsonText-Roman.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/crimson/CrimsonText-Semibold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/crimson/CrimsonText-Semibold.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/crimson/CrimsonText-SemiboldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/crimson/CrimsonText-SemiboldItalic.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/crushed/Crushed.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/crushed/Crushed.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/cuprum/Cuprum.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/cuprum/Cuprum.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/cuprum/Cuprum.ttf.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /cpp/data/fonts/damion/Damion-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/damion/Damion-Regular.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/dancingscript/DancingScript-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/dancingscript/DancingScript-Bold.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/dancingscript/DancingScript-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/dancingscript/DancingScript-Regular.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/dangrek/Dangrek.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/dangrek/Dangrek.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/dawningofanewday/DawningofaNewDay.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/dawningofanewday/DawningofaNewDay.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/daysone/DaysOne-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/daysone/DaysOne-Regular.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/daysone/DaysOne-Regular.ttf.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /cpp/data/fonts/delius/Delius-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/delius/Delius-Regular.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/deliusswashcaps/DeliusSwashCaps-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/deliusswashcaps/DeliusSwashCaps-Regular.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/deliusunicase/DeliusUnicase-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/deliusunicase/DeliusUnicase-Regular.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/didactgothic/DidactGothic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/didactgothic/DidactGothic.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/dorsa/Dorsa-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/dorsa/Dorsa-Regular.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/dorsa/Dorsa-Regular.ttf.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /cpp/data/fonts/ebgaramond/EBGaramond-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/ebgaramond/EBGaramond-Regular.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/expletussans/ExpletusSans-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/expletussans/ExpletusSans-Bold.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/expletussans/ExpletusSans-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/expletussans/ExpletusSans-BoldItalic.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/expletussans/ExpletusSans-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/expletussans/ExpletusSans-Italic.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/expletussans/ExpletusSans-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/expletussans/ExpletusSans-Medium.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/expletussans/ExpletusSans-MediumItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/expletussans/ExpletusSans-MediumItalic.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/expletussans/ExpletusSans-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/expletussans/ExpletusSans-Regular.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/expletussans/ExpletusSans-SemiBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/expletussans/ExpletusSans-SemiBold.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/expletussans/ExpletusSans-SemiBoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/expletussans/ExpletusSans-SemiBoldItalic.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/fanwoodtext/FanwoodText-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/fanwoodtext/FanwoodText-Italic.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/fanwoodtext/FanwoodText-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/fanwoodtext/FanwoodText-Regular.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/federo/Federo-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/federo/Federo-Regular.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/felltypes/IMFeDPit28P.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/felltypes/IMFeDPit28P.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/felltypes/IMFeDPit28P.ttf.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /cpp/data/fonts/felltypes/IMFeDPrm28P.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/felltypes/IMFeDPrm28P.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/felltypes/IMFeDPsc28P.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/felltypes/IMFeDPsc28P.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/felltypes/IMFeDPsc28P.ttf.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /cpp/data/fonts/felltypes/IMFeENit28P.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/felltypes/IMFeENit28P.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/felltypes/IMFeENrm28P.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/felltypes/IMFeENrm28P.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/felltypes/IMFeENsc28P.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/felltypes/IMFeENsc28P.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/felltypes/IMFeENsc28P.ttf.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /cpp/data/fonts/felltypes/IMFeFCit28P.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/felltypes/IMFeFCit28P.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/felltypes/IMFeFCrm28P.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/felltypes/IMFeFCrm28P.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/felltypes/IMFeFCsc28P.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/felltypes/IMFeFCsc28P.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/felltypes/IMFeGPit28P.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/felltypes/IMFeGPit28P.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/felltypes/IMFeGPrm28P.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/felltypes/IMFeGPrm28P.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/felltypes/IMFeGPsc28P.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/felltypes/IMFeGPsc28P.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/felltypes/IMFeGPsc28P.ttf.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /cpp/data/fonts/felltypes/IMFePIit28P.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/felltypes/IMFePIit28P.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/felltypes/IMFePIrm28P.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/felltypes/IMFePIrm28P.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/felltypes/IMFePIsc28P.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/felltypes/IMFePIsc28P.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/felltypes/IMFePIsc28P.ttf.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /cpp/data/fonts/forum/Forum-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/forum/Forum-Regular.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/francoisone/FrancoisOne.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/francoisone/FrancoisOne.ttf -------------------------------------------------------------------------------- /cpp/data/fonts/freehand/Freehand.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/data/fonts/freehand/Freehand.ttf -------------------------------------------------------------------------------- /cpp/ext/.gitignore: -------------------------------------------------------------------------------- 1 | /gtest 2 | -------------------------------------------------------------------------------- /cpp/ext/redist/cmake-2.8.5-win32-x86.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/ext/redist/cmake-2.8.5-win32-x86.zip -------------------------------------------------------------------------------- /cpp/ext/redist/gtest-1.6.0.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/ext/redist/gtest-1.6.0.zip -------------------------------------------------------------------------------- /cpp/ext/redist/icu4c-4_6_1-Win32-msvc10.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/cpp/ext/redist/icu4c-4_6_1-Win32-msvc10.zip -------------------------------------------------------------------------------- /cpp/src/sample/subsetter/main.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | #if _MSC_VER > 12 19 | #define _CRTDBG_MAP_ALLOC 20 | #include 21 | #include 22 | #endif 23 | 24 | #include "sample/subsetter/subset_util.h" 25 | 26 | int main(int argc, char** argv) { 27 | #ifdef _CRTDBG_MAP_ALLOC 28 | _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); 29 | #endif 30 | 31 | if (argc < 3) { 32 | printf("Usage: subsetter \n"); 33 | return 0; 34 | } 35 | 36 | sfntly::SubsetUtil subset_util; 37 | subset_util.Subset(argv[1], argv[2]); 38 | 39 | #ifdef _CRTDBG_MAP_ALLOC 40 | _CrtDumpMemoryLeaks(); 41 | #endif 42 | 43 | return 0; 44 | } 45 | -------------------------------------------------------------------------------- /cpp/src/sample/subsetter/subset_util.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef SFNTLY_CPP_SRC_SAMPLE_SUBSETTER_SUBSET_UTIL_H_ 18 | #define SFNTLY_CPP_SRC_SAMPLE_SUBSETTER_SUBSET_UTIL_H_ 19 | 20 | namespace sfntly { 21 | 22 | class SubsetUtil { 23 | public: 24 | SubsetUtil(); 25 | virtual ~SubsetUtil(); 26 | 27 | void Subset(const char* input_file_path, const char* output_file_path); 28 | }; 29 | 30 | } // namespace sfntly 31 | 32 | #endif // SFNTLY_CPP_SRC_SAMPLE_SUBSETTER_SUBSET_UTIL_H_ 33 | -------------------------------------------------------------------------------- /cpp/src/sample/subtly/character_predicate.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include "sfntly/port/refcount.h" 18 | #include "subtly/character_predicate.h" 19 | 20 | namespace subtly { 21 | using namespace sfntly; 22 | 23 | // AcceptRange predicate 24 | AcceptRange::AcceptRange(int32_t start, int32_t end) 25 | : start_(start), 26 | end_(end) { 27 | } 28 | 29 | AcceptRange::~AcceptRange() {} 30 | 31 | bool AcceptRange::operator()(int32_t character) const { 32 | return start_ <= character && character <= end_; 33 | } 34 | 35 | // AcceptSet predicate 36 | AcceptSet::AcceptSet(IntegerSet* characters) 37 | : characters_(characters) { 38 | } 39 | 40 | AcceptSet::~AcceptSet() { 41 | delete characters_; 42 | } 43 | 44 | bool AcceptSet::operator()(int32_t character) const { 45 | return characters_->find(character) != characters_->end(); 46 | } 47 | 48 | // AcceptAll predicate 49 | bool AcceptAll::operator()(int32_t character) const { 50 | UNREFERENCED_PARAMETER(character); 51 | return true; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /cpp/src/sample/subtly/merger.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef TYPOGRAPHY_FONT_SFNTLY_SRC_SAMPLE_SUBTLY_MERGER_H_ 18 | #define TYPOGRAPHY_FONT_SFNTLY_SRC_SAMPLE_SUBTLY_MERGER_H_ 19 | 20 | #include "subtly/character_predicate.h" 21 | #include "subtly/font_info.h" 22 | 23 | namespace sfntly { 24 | class Font; 25 | } 26 | 27 | namespace subtly { 28 | // Merges the subsets in the font array into a single font. 29 | class Merger : public sfntly::RefCounted { 30 | public: 31 | explicit Merger(sfntly::FontArray* fonts); 32 | virtual ~Merger() { } 33 | 34 | // Performs merging returning the subsetted font. 35 | virtual CALLER_ATTACH sfntly::Font* Merge(); 36 | 37 | protected: 38 | virtual CALLER_ATTACH FontInfo* MergeFontInfos(); 39 | 40 | private: 41 | FontIdMap fonts_; 42 | }; 43 | } 44 | 45 | #endif // TYPOGRAPHY_FONT_SFNTLY_SRC_SAMPLE_SUBTLY_MERGER_H_ 46 | -------------------------------------------------------------------------------- /cpp/src/sample/subtly/stats.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef TYPOGRAPHY_FONT_SFNTLY_SRC_SAMPLE_SUBTLY_STATS_H_ 18 | #define TYPOGRAPHY_FONT_SFNTLY_SRC_SAMPLE_SUBTLY_STATS_H_ 19 | 20 | #include 21 | 22 | #include "sfntly/port/type.h" 23 | 24 | namespace sfntly { 25 | class Font; 26 | } 27 | 28 | namespace subtly { 29 | using namespace sfntly; 30 | 31 | int32_t TotalFontSize(Font* font); 32 | 33 | double TableSizePercent(Font* font, int32_t tag); 34 | 35 | void PrintComparison(FILE* out, Font* font, Font* new_font); 36 | 37 | void PrintStats(FILE* out, Font* font); 38 | } 39 | 40 | #endif // TYPOGRAPHY_FONT_SFNTLY_SRC_SAMPLE_SUBTLY_STATS_H_ 41 | -------------------------------------------------------------------------------- /cpp/src/sample/subtly/subsetter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef TYPOGRAPHY_FONT_SFNTLY_SRC_SAMPLE_SUBTLY_SUBSETTER_H_ 18 | #define TYPOGRAPHY_FONT_SFNTLY_SRC_SAMPLE_SUBTLY_SUBSETTER_H_ 19 | 20 | #include "sfntly/font.h" 21 | // Cannot remove this header due to Ptr instantiation issue 22 | #include "subtly/character_predicate.h" 23 | 24 | namespace subtly { 25 | // Subsets a given font using a character predicate. 26 | class Subsetter : public sfntly::RefCounted { 27 | public: 28 | Subsetter(sfntly::Font* font, CharacterPredicate* predicate); 29 | Subsetter(const char* font_path, CharacterPredicate* predicate); 30 | virtual ~Subsetter() { } 31 | 32 | // Performs subsetting returning the subsetted font. 33 | virtual CALLER_ATTACH sfntly::Font* Subset(); 34 | 35 | private: 36 | sfntly::Ptr font_; 37 | sfntly::Ptr predicate_; 38 | }; 39 | } 40 | 41 | #endif // TYPOGRAPHY_FONT_SFNTLY_SRC_SAMPLE_SUBTLY_SUBSETTER_H_ 42 | -------------------------------------------------------------------------------- /cpp/src/sample/subtly/utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef TYPOGRAPHY_FONT_SFNTLY_SRC_SAMPLE_SUBTLY_UTILS_H_ 18 | #define TYPOGRAPHY_FONT_SFNTLY_SRC_SAMPLE_SUBTLY_UTILS_H_ 19 | 20 | #include "sfntly/font.h" 21 | #include "sfntly/font_factory.h" 22 | 23 | namespace subtly { 24 | CALLER_ATTACH sfntly::Font* LoadFont(const char* font_path); 25 | CALLER_ATTACH sfntly::Font::Builder* LoadFontBuilder(const char* font_path); 26 | 27 | void LoadFonts(const char* font_path, sfntly::FontFactory* factory, 28 | sfntly::FontArray* fonts); 29 | void LoadFontBuilders(const char* font_path, 30 | sfntly::FontFactory* factory, 31 | sfntly::FontBuilderArray* builders); 32 | 33 | bool SerializeFont(const char* font_path, sfntly::Font* font); 34 | bool SerializeFont(const char* font_path, sfntly::FontFactory* factory, 35 | sfntly::Font* font); 36 | } 37 | 38 | #endif // TYPOGRAPHY_FONT_SFNTLY_SRC_SAMPLE_SUBTLY_UTILS_H_ 39 | -------------------------------------------------------------------------------- /cpp/src/sfntly/math/fixed1616.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef SFNTLY_CPP_SRC_SFNTLY_MATH_FIXED1616_H_ 18 | #define SFNTLY_CPP_SRC_SFNTLY_MATH_FIXED1616_H_ 19 | 20 | #include "sfntly/port/type.h" 21 | 22 | namespace sfntly { 23 | 24 | class Fixed1616 { 25 | public: 26 | static inline int32_t Integral(int32_t fixed) { 27 | return (fixed >> 16); 28 | } 29 | 30 | static inline int32_t Fractional(int32_t fixed) { 31 | return (fixed & 0xffff); 32 | } 33 | 34 | static inline int32_t Fixed(int32_t integral, int32_t fractional) { 35 | return ((integral & 0xffff) << 16) | (fractional & 0xffff); 36 | } 37 | }; 38 | 39 | } // namespace sfntly 40 | 41 | #endif // SFNTLY_CPP_SRC_SFNTLY_MATH_FIXED1616_H_ 42 | -------------------------------------------------------------------------------- /cpp/src/sfntly/port/config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef SFNTLY_CPP_SRC_SFNTLY_PORT_CONFIG_H_ 18 | #define SFNTLY_CPP_SRC_SFNTLY_PORT_CONFIG_H_ 19 | 20 | #if !defined(SFNTLY_BIG_ENDIAN) && !defined(SFNTLY_LITTLE_ENDIAN) 21 | #if defined (__ppc__) || defined (__ppc64__) 22 | #define SFNTLY_BIG_ENDIAN 23 | #else 24 | #define SFNTLY_LITTLE_ENDIAN 25 | #endif 26 | #endif 27 | 28 | #endif // SFNTLY_CPP_SRC_SFNTLY_PORT_CONFIG_H_ 29 | -------------------------------------------------------------------------------- /cpp/src/sfntly/port/input_stream.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef SFNTLY_CPP_SRC_SFNTLY_PORT_INPUT_STREAM_H_ 18 | #define SFNTLY_CPP_SRC_SFNTLY_PORT_INPUT_STREAM_H_ 19 | 20 | #include "sfntly/port/type.h" 21 | 22 | namespace sfntly { 23 | 24 | // C++ equivalent to Java's OutputStream class 25 | class InputStream { 26 | public: 27 | virtual int32_t Length() = 0; 28 | virtual int32_t Available() = 0; 29 | virtual void Close() = 0; 30 | virtual void Mark(int32_t readlimit) = 0; 31 | virtual bool MarkSupported() = 0; 32 | virtual int32_t Read() = 0; 33 | virtual int32_t Read(std::vector* b) = 0; 34 | virtual int32_t Read(std::vector* b, int32_t offset, int32_t length) = 0; 35 | virtual void Reset() = 0; 36 | virtual int64_t Skip(int64_t n) = 0; 37 | 38 | protected: 39 | virtual ~InputStream() {} 40 | }; 41 | 42 | class PushbackInputStream : public InputStream { 43 | public: 44 | virtual void Unread(std::vector* b) = 0; 45 | virtual void Unread(std::vector* b, int32_t offset, int32_t length) = 0; 46 | }; 47 | 48 | } // namespace sfntly 49 | 50 | #endif // SFNTLY_CPP_SRC_SFNTLY_PORT_INPUT_STREAM_H_ 51 | -------------------------------------------------------------------------------- /cpp/src/sfntly/port/logging.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef SFNTLY_CPP_SRC_SFNTLY_PORT_LOGGING_H_ 18 | #define SFNTLY_CPP_SRC_SFNTLY_PORT_LOGGING_H_ 19 | 20 | #include 21 | #include 22 | 23 | // Cheap base/logging.h knock off. 24 | 25 | #define CHECK(expr) \ 26 | if (!(expr)) { \ 27 | printf("CHECK failed\n"); \ 28 | abort(); \ 29 | } 30 | 31 | #endif // SFNTLY_CPP_SRC_SFNTLY_PORT_LOGGING_H_ 32 | -------------------------------------------------------------------------------- /cpp/src/sfntly/port/memory_output_stream.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef SFNTLY_CPP_SRC_SFNTLY_PORT_MEMORY_OUTPUT_STREAM_H_ 18 | #define SFNTLY_CPP_SRC_SFNTLY_PORT_MEMORY_OUTPUT_STREAM_H_ 19 | 20 | #include 21 | #include 22 | 23 | #include "sfntly/port/type.h" 24 | #include "sfntly/port/output_stream.h" 25 | 26 | namespace sfntly { 27 | 28 | // OutputStream backed by STL vector 29 | 30 | class MemoryOutputStream : public OutputStream { 31 | public: 32 | MemoryOutputStream(); 33 | virtual ~MemoryOutputStream(); 34 | 35 | virtual void Close() {} // no-op 36 | virtual void Flush() {} // no-op 37 | virtual void Write(std::vector* buffer); 38 | virtual void Write(std::vector* buffer, int32_t offset, int32_t length); 39 | virtual void Write(uint8_t* buffer, int32_t offset, int32_t length); 40 | virtual void Write(uint8_t b); 41 | 42 | uint8_t* Get(); 43 | size_t Size(); 44 | 45 | private: 46 | std::vector store_; 47 | }; 48 | 49 | } // namespace sfntly 50 | 51 | #endif // SFNTLY_CPP_SRC_SFNTLY_PORT_MEMORY_OUTPUT_STREAM_H_ 52 | -------------------------------------------------------------------------------- /cpp/src/sfntly/port/output_stream.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef SFNTLY_CPP_SRC_SFNTLY_PORT_OUTPUT_STREAM_H_ 18 | #define SFNTLY_CPP_SRC_SFNTLY_PORT_OUTPUT_STREAM_H_ 19 | 20 | #include "sfntly/port/type.h" 21 | 22 | namespace sfntly { 23 | 24 | // C++ equivalent to Java's OutputStream class 25 | class OutputStream { 26 | public: 27 | // Make gcc -Wnon-virtual-dtor happy. 28 | virtual ~OutputStream() {} 29 | 30 | virtual void Close() = 0; 31 | virtual void Flush() = 0; 32 | virtual void Write(std::vector* buffer) = 0; 33 | virtual void Write(uint8_t b) = 0; 34 | 35 | // Note: C++ port offered both versions of Write() here. The first one is 36 | // better because it does check bounds. The second one is there for 37 | // performance concerns. 38 | virtual void Write(std::vector* buffer, int32_t offset, int32_t length) = 0; 39 | 40 | // Note: Caller is responsible for the boundary of buffer. 41 | virtual void Write(uint8_t* buffer, int32_t offset, int32_t length) = 0; 42 | }; 43 | 44 | } // namespace sfntly 45 | 46 | #endif // SFNTLY_CPP_SRC_SFNTLY_PORT_OUTPUT_STREAM_H_ 47 | -------------------------------------------------------------------------------- /cpp/src/sfntly/table/bitmap/glyph_metrics.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include "sfntly/table/bitmap/glyph_metrics.h" 18 | 19 | namespace sfntly { 20 | 21 | GlyphMetrics::~GlyphMetrics() { 22 | } 23 | 24 | GlyphMetrics::GlyphMetrics(ReadableFontData* data) 25 | : SubTable(data) { 26 | } 27 | 28 | GlyphMetrics::Builder::~Builder() { 29 | } 30 | 31 | GlyphMetrics::Builder::Builder(WritableFontData* data) 32 | : SubTable::Builder(data) { 33 | } 34 | 35 | GlyphMetrics::Builder::Builder(ReadableFontData* data) 36 | : SubTable::Builder(data) { 37 | } 38 | 39 | } // namespace sfntly 40 | -------------------------------------------------------------------------------- /cpp/src/sfntly/table/bitmap/glyph_metrics.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef SFNTLY_CPP_SRC_SFNTLY_TABLE_BITMAP_GLYPH_METRICS_H_ 18 | #define SFNTLY_CPP_SRC_SFNTLY_TABLE_BITMAP_GLYPH_METRICS_H_ 19 | 20 | #include "sfntly/table/subtable.h" 21 | 22 | namespace sfntly { 23 | 24 | class GlyphMetrics : public SubTable { 25 | public: 26 | virtual ~GlyphMetrics(); 27 | 28 | protected: 29 | class Builder : public SubTable::Builder { 30 | public: 31 | virtual ~Builder(); 32 | 33 | protected: 34 | explicit Builder(WritableFontData* data); 35 | explicit Builder(ReadableFontData* data); 36 | }; 37 | 38 | explicit GlyphMetrics(ReadableFontData* data); 39 | }; 40 | 41 | } // namespace sfntly 42 | 43 | #endif // SFNTLY_CPP_SRC_SFNTLY_TABLE_BITMAP_GLYPH_METRICS_H_ 44 | -------------------------------------------------------------------------------- /cpp/src/sfntly/table/bitmap/simple_bitmap_glyph.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 = the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include "sfntly/table/bitmap/simple_bitmap_glyph.h" 18 | 19 | namespace sfntly { 20 | 21 | SimpleBitmapGlyph::SimpleBitmapGlyph(ReadableFontData* data, int32_t format) 22 | : BitmapGlyph(data, format) { 23 | } 24 | 25 | SimpleBitmapGlyph::~SimpleBitmapGlyph() { 26 | } 27 | 28 | SimpleBitmapGlyph::Builder::Builder(ReadableFontData* data, int32_t format) 29 | : BitmapGlyph::Builder(data, format) { 30 | } 31 | 32 | SimpleBitmapGlyph::Builder::Builder(WritableFontData* data, int32_t format) 33 | : BitmapGlyph::Builder(data, format) { 34 | } 35 | 36 | SimpleBitmapGlyph::Builder::~Builder() { 37 | } 38 | 39 | CALLER_ATTACH FontDataTable* 40 | SimpleBitmapGlyph::Builder::SubBuildTable(ReadableFontData* data) { 41 | Ptr glyph = new SimpleBitmapGlyph(data, format()); 42 | return glyph.Detach(); 43 | } 44 | 45 | } // namespace sfntly 46 | -------------------------------------------------------------------------------- /cpp/src/sfntly/table/bitmap/simple_bitmap_glyph.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 = the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef SFNTLY_CPP_SRC_SFNTLY_TABLE_BITMAP_SIMPLE_BITMAP_GLYPH_H_ 18 | #define SFNTLY_CPP_SRC_SFNTLY_TABLE_BITMAP_SIMPLE_BITMAP_GLYPH_H_ 19 | 20 | #include "sfntly/table/bitmap/bitmap_glyph.h" 21 | 22 | namespace sfntly { 23 | 24 | class SimpleBitmapGlyph : public BitmapGlyph, 25 | public RefCounted { 26 | public: 27 | class Builder : public BitmapGlyph::Builder, 28 | public RefCounted { 29 | public: 30 | Builder(WritableFontData* data, int32_t format); 31 | Builder(ReadableFontData* data, int32_t format); 32 | virtual ~Builder(); 33 | 34 | virtual CALLER_ATTACH FontDataTable* SubBuildTable(ReadableFontData* data); 35 | }; 36 | 37 | SimpleBitmapGlyph(ReadableFontData* data, int32_t format); 38 | virtual ~SimpleBitmapGlyph(); 39 | }; 40 | typedef Ptr SimpleBitmapGlyphPtr; 41 | 42 | } // namespace sfntly 43 | 44 | #endif // SFNTLY_CPP_SRC_SFNTLY_TABLE_BITMAP_SIMPLE_BITMAP_GLYPH_H_ 45 | -------------------------------------------------------------------------------- /cpp/src/sfntly/table/generic_table_builder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef SFNTLY_CPP_SRC_SFNTLY_TABLE_GENERIC_TABLE_BUILDER_H_ 18 | #define SFNTLY_CPP_SRC_SFNTLY_TABLE_GENERIC_TABLE_BUILDER_H_ 19 | 20 | #include "sfntly/table/table_based_table_builder.h" 21 | 22 | namespace sfntly { 23 | 24 | // A table builder to do the minimal table building for an unknown table type. 25 | class GenericTableBuilder : public TableBasedTableBuilder, 26 | public RefCounted { 27 | public: 28 | virtual ~GenericTableBuilder(); 29 | 30 | virtual CALLER_ATTACH FontDataTable* SubBuildTable(ReadableFontData* data); 31 | 32 | static CALLER_ATTACH GenericTableBuilder* 33 | CreateBuilder(Header* header, WritableFontData* data); 34 | 35 | private: 36 | GenericTableBuilder(Header* header, WritableFontData* data); 37 | GenericTableBuilder(Header* header, ReadableFontData* data); 38 | }; 39 | 40 | } // namespace sfntly 41 | 42 | #endif // SFNTLY_CPP_SRC_SFNTLY_TABLE_BYTE_ARRAY_TABLE_BUILDER_H_ 43 | -------------------------------------------------------------------------------- /cpp/src/sfntly/table/subtable_container_table.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef TYPOGRAPHY_FONT_SFNTLY_SRC_SFNTLY_TABLE_SUBTABLE_CONTAINER_TABLE_H_ 18 | #define TYPOGRAPHY_FONT_SFNTLY_SRC_SFNTLY_TABLE_SUBTABLE_CONTAINER_TABLE_H_ 19 | 20 | #include "sfntly/table/table.h" 21 | 22 | namespace sfntly { 23 | 24 | class SubTableContainerTable : public Table { 25 | public: 26 | class Builder : public Table::Builder { 27 | public: 28 | Builder(Header* header, WritableFontData* data) 29 | : Table::Builder(header, data) { 30 | } 31 | 32 | Builder(Header* header, ReadableFontData* data) 33 | : Table::Builder(header, data) { 34 | } 35 | 36 | virtual ~Builder() {} 37 | }; 38 | 39 | SubTableContainerTable(Header* header, ReadableFontData* data) 40 | : Table(header, data) { 41 | } 42 | 43 | virtual ~SubTableContainerTable() {} 44 | }; 45 | 46 | } // namespace sfntly 47 | 48 | #endif // TYPOGRAPHY_FONT_SFNTLY_SRC_SFNTLY_TABLE_SUBTABLE_CONTAINER_TABLE_H_ 49 | -------------------------------------------------------------------------------- /cpp/src/sfntly/tools/subsetter/glyph_table_subsetter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef SFNTLY_CPP_SRC_SFNTLY_TOOLS_SUBSETTER_GLYPH_TABLE_SUBSETTER_H_ 18 | #define SFNTLY_CPP_SRC_SFNTLY_TOOLS_SUBSETTER_GLYPH_TABLE_SUBSETTER_H_ 19 | 20 | #include "sfntly/tools/subsetter/table_subsetter_impl.h" 21 | 22 | namespace sfntly { 23 | 24 | class GlyphTableSubsetter : public TableSubsetterImpl, 25 | public RefCounted { 26 | public: 27 | GlyphTableSubsetter(); 28 | virtual ~GlyphTableSubsetter(); 29 | 30 | virtual bool Subset(Subsetter* subsetter, 31 | Font* font, 32 | Font::Builder* font_builder); 33 | }; 34 | 35 | } // namespace sfntly 36 | 37 | #endif // SFNTLY_CPP_SRC_SFNTLY_TOOLS_SUBSETTER_GLYPH_TABLE_SUBSETTER_H_ 38 | -------------------------------------------------------------------------------- /cpp/src/sfntly/tools/subsetter/table_subsetter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef SFNTLY_CPP_SRC_SFNTLY_TOOLS_SUBSETTER_TABLE_SUBSETTER_H_ 18 | #define SFNTLY_CPP_SRC_SFNTLY_TOOLS_SUBSETTER_TABLE_SUBSETTER_H_ 19 | 20 | #include 21 | 22 | #include "sfntly/font.h" 23 | 24 | namespace sfntly { 25 | 26 | class Subsetter; 27 | class TableSubsetter : virtual public RefCount { 28 | public: 29 | virtual std::set* TagsHandled() = 0; 30 | virtual bool TagHandled(int32_t tag) = 0; 31 | virtual bool Subset(Subsetter* subsetter, Font* font, 32 | Font::Builder* font_builder) = 0; 33 | }; 34 | typedef Ptr TableSubsetterPtr; 35 | typedef std::vector TableSubsetterList; 36 | 37 | } // namespace sfntly 38 | 39 | #endif // SFNTLY_CPP_SRC_SFNTLY_TOOLS_SUBSETTER_TABLE_SUBSETTER_H_ 40 | -------------------------------------------------------------------------------- /cpp/src/sfntly/tools/subsetter/table_subsetter_impl.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include "sfntly/tools/subsetter/table_subsetter_impl.h" 18 | 19 | namespace sfntly { 20 | 21 | TableSubsetterImpl::TableSubsetterImpl(const int32_t* tags, 22 | size_t tags_length) { 23 | for (size_t i = 0; i < tags_length; ++i) { 24 | tags_.insert(tags[i]); 25 | } 26 | } 27 | 28 | TableSubsetterImpl::~TableSubsetterImpl() {} 29 | 30 | bool TableSubsetterImpl::TagHandled(int32_t tag) { 31 | return tags_.find(tag) != tags_.end(); 32 | } 33 | 34 | std::set* TableSubsetterImpl::TagsHandled() { 35 | return &tags_; 36 | } 37 | 38 | } // namespace sfntly 39 | -------------------------------------------------------------------------------- /cpp/src/sfntly/tools/subsetter/table_subsetter_impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef SFNTLY_CPP_SRC_SFNTLY_TOOLS_SUBSETTER_TABLE_SUBSETTER_IMPL_H_ 18 | #define SFNTLY_CPP_SRC_SFNTLY_TOOLS_SUBSETTER_TABLE_SUBSETTER_IMPL_H_ 19 | 20 | #include "sfntly/tools/subsetter/table_subsetter.h" 21 | 22 | namespace sfntly { 23 | 24 | class TableSubsetterImpl : public TableSubsetter { 25 | public: 26 | TableSubsetterImpl(const int32_t* tags, size_t tags_length); 27 | virtual ~TableSubsetterImpl(); 28 | virtual bool TagHandled(int32_t tag); 29 | virtual std::set* TagsHandled(); 30 | 31 | protected: 32 | std::set tags_; 33 | }; 34 | 35 | } // namespace sfntly 36 | 37 | #endif // SFNTLY_CPP_SRC_SFNTLY_TOOLS_SUBSETTER_TABLE_SUBSETTER_IMPL_H_ 38 | -------------------------------------------------------------------------------- /cpp/src/test/serialization_test.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef SFNTLY_CPP_SRC_TEST_SERIALIZATION_TEST_H_ 18 | #define SFNTLY_CPP_SRC_TEST_SERIALIZATION_TEST_H_ 19 | 20 | #include "sfntly/table/table.h" 21 | 22 | namespace sfntly { 23 | 24 | bool VerifyHHEA(Table* original, Table* target); 25 | bool VerifyGLYF(Table* original, Table* target); 26 | bool VerifyHMTX(Table* original, Table* target); 27 | bool VerifyLOCA(Table* original, Table* target); 28 | bool VerifyMAXP(Table* original, Table* target); 29 | bool VerifyNAME(Table* original, Table* target); 30 | bool VerifyOS_2(Table* original, Table* target); 31 | 32 | } // namespace sfntly 33 | 34 | #endif // SFNTLY_CPP_SRC_TEST_SERIALIZATION_TEST_H_ 35 | -------------------------------------------------------------------------------- /cpp/src/test/test_data.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef SFNTLY_CPP_SRC_TEST_TEST_DATA_H_ 18 | #define SFNTLY_CPP_SRC_TEST_TEST_DATA_H_ 19 | 20 | #include "sfntly/tag.h" 21 | 22 | namespace sfntly { 23 | 24 | extern const char* SAMPLE_TTF_FILE; 25 | extern const char* SAMPLE_BITMAP_FONT; 26 | 27 | extern const size_t SAMPLE_TTF_SIZE; 28 | extern const size_t SAMPLE_TTF_TABLES; 29 | extern const size_t SAMPLE_TTF_KNOWN_TAGS; 30 | extern const size_t SAMPLE_BITMAP_KNOWN_TAGS; 31 | extern const size_t SAMPLE_TTF_FEAT; 32 | extern const size_t SAMPLE_TTF_HEAD; 33 | extern const size_t SAMPLE_TTF_POST; 34 | 35 | extern const int32_t TTF_KNOWN_TAGS[]; 36 | extern const int32_t BITMAP_KNOWN_TAGS[]; 37 | extern const int64_t TTF_CHECKSUM[]; 38 | extern const int64_t TTF_OFFSET[]; 39 | extern const int32_t TTF_LENGTH[]; 40 | extern const unsigned char TTF_FEAT_DATA[]; 41 | 42 | } // namespace sfntly 43 | 44 | #endif // SFNTLY_CPP_SRC_TEST_TEST_DATA_H_ 45 | -------------------------------------------------------------------------------- /cpp/src/test/test_font_utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef SFNTLY_CPP_SRC_TEST_TEST_FONT_UTILS_H_ 18 | #define SFNTLY_CPP_SRC_TEST_TEST_FONT_UTILS_H_ 19 | 20 | #include "sfntly/font.h" 21 | #include "sfntly/font_factory.h" 22 | #include "sfntly/port/memory_output_stream.h" 23 | 24 | namespace sfntly { 25 | 26 | void BuilderForFontFile(const char* font_path, FontFactory* factory, 27 | FontBuilderArray* builders); 28 | void SerializeFont(const char* font_path, FontFactory* factory, Font* font); 29 | void LoadFont(const char* font_path, FontFactory* factory, FontArray* fonts); 30 | void LoadFontUsingByteVector(const char* font_path, 31 | bool fingerprint, 32 | FontArray* fonts); 33 | 34 | void LoadFile(const char* input_file_path, ByteVector* input_buffer); 35 | void SerializeToFile(MemoryOutputStream* output_stream, const char* file_path); 36 | 37 | void HexDump(const unsigned char* byte_data, size_t length); 38 | 39 | } // namespace sfntly 40 | 41 | #endif // SFNTLY_CPP_SRC_TEST_TEST_FONT_UTILS_H_ 42 | -------------------------------------------------------------------------------- /cpp/src/test/test_xml_utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include "sfntly/port/refcount.h" 18 | #include "test/tinyxml/tinyxml.h" 19 | 20 | #ifndef SFNTLY_CPP_SRC_TEST_TEST_XML_UTILS_H_ 21 | #define SFNTLY_CPP_SRC_TEST_TEST_XML_UTILS_H_ 22 | 23 | namespace sfntly { 24 | typedef std::map AttributeMap; 25 | typedef std::vector TiXmlNodeVector; 26 | 27 | TiXmlNodeVector* GetNodesWithName(const TiXmlNode* node, 28 | const std::string& name); 29 | const TiXmlAttribute* GetAttribute(const TiXmlNode* node, 30 | const std::string& name); 31 | } // namespace sfntly 32 | 33 | #endif // SFNTLY_CPP_SRC_TEST_TEST_XML_UTILS_H_ 34 | -------------------------------------------------------------------------------- /cpp/tools/README-test_data.txt: -------------------------------------------------------------------------------- 1 | To generate test data: 2 | In the current directory (tools/): 3 | 4 | 1. XML test data, run: 5 | $ python generate_test_data_xml.py 6 | 7 | 2. C++ test data (.h file containing the list of fonts to be tested), run: 8 | $ python generate_file_list_cc.py 9 | (after having generated the xml data) 10 | 11 | By default the XML files are put in the same folder as the font they were 12 | created from and the CMap test data is put in $PWD. 13 | 14 | To get the list of paramters for both scripts run them with the --help option. 15 | 16 | When adding new fonts to data/fonts/ (possibly by cloning the Google Web Fonts 17 | directory), run the cleanup script: 18 | $ python clean_fonts_repo.py 19 | to delete all files that are not {.ttf, .ttc, .otf, OFL.txt} and all files that 20 | are more than 1 level deep from a font's folder. 21 | (e.g. for copse/ it will delete all subfolders of copse/ and should only leave 22 | the font and the license file untouched - and possibly an empty src folder; 23 | however since empty folders are not added to git, they will be discarded when 24 | committing the new fonts). 25 | -------------------------------------------------------------------------------- /cpp/tools/README_xml.txt: -------------------------------------------------------------------------------- 1 | Commented test data sample 2 | -------------------------- 3 | All of the attributes are REQUIRED unless otherwise noted. 4 | 5 | 10 | 13 | 21 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /cpp/tools/test_data_generator_xml.py: -------------------------------------------------------------------------------- 1 | # Copyright 2011 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limit 14 | 15 | """Main module, generates XML for all test files.""" 16 | 17 | import os 18 | from font_data_generator_xml import FontDataGeneratorXML 19 | 20 | 21 | class TestDataGeneratorXML(object): 22 | """Generates XML data for fonts using the provided |table_data_generators|.""" 23 | 24 | def __init__(self, table_data_generators, fonts, destination): 25 | self.table_data_generators = table_data_generators 26 | self.fonts = fonts 27 | self.destination = destination 28 | 29 | def Generate(self): 30 | for font_path in self.fonts: 31 | print 'Processing font ' + font_path 32 | document = FontDataGeneratorXML(self.table_data_generators, 33 | font_path).Generate() 34 | xml_path = (font_path 35 | if not self.destination else 36 | self.destination + os.path.basename(font_path)) + '.xml' 37 | xml_file = open(xml_path, 'w') 38 | xml_file.write(document.toprettyxml().replace('\t', ' ')) 39 | xml_file.close() 40 | -------------------------------------------------------------------------------- /data/testdata/DroidSans-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/data/testdata/DroidSans-Regular.ttf -------------------------------------------------------------------------------- /data/testdata/OpenSans-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/data/testdata/OpenSans-Regular.ttf -------------------------------------------------------------------------------- /data/testdata/Roboto-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rillig/sfntly/ea0893911b86edbd15cf8478594e4f683c8d4ec1/data/testdata/Roboto-Regular.ttf -------------------------------------------------------------------------------- /doc/Useful_links.md: -------------------------------------------------------------------------------- 1 | Wiki 2 | 3 | - TrueType 4 | [http://en.wikipedia.org/wiki/TrueType](http://en.wikipedia.org/wiki/TrueType) 5 | - OpenType 6 | [http://en.wikipedia.org/wiki/OpenType](http://en.wikipedia.org/wiki/OpenType) 7 | 8 | Microsoft Typography 9 | [http://www.microsoft.com/typography/default.mspx](http://www.microsoft.com/typography/default.mspx) 10 | 11 | - Font specifications 12 | [http://www.microsoft.com/typography/SpecificationsOverview.mspx](http://www.microsoft.com/typography/SpecificationsOverview.mspx), 13 | including OpenType and TrueType. 14 | - Font Tools 15 | [http://www.microsoft.com/typography/tools/tools.aspx](http://www.microsoft.com/typography/tools/tools.aspx) 16 | 17 | Apple 18 | 19 | - TrueType reference manual 20 | [http://developer.apple.com/fonts/TTRefMan](http://developer.apple.com/fonts/TTRefMan) 21 | 22 | Adobe 23 | 24 | - OpenType 25 | [http://www.adobe.com/type/opentype/](http://www.adobe.com/type/opentype/) 26 | -------------------------------------------------------------------------------- /doc/unit_tests.md: -------------------------------------------------------------------------------- 1 | []{#Unit_Test}Unit Test[](#Unit_Test){.section_anchor} 2 | ====================================================== 3 | 4 | sfntly C++ port uses Google testing framework for unit testing. 5 | 6 | All test cases are under src/test. 7 | 8 | To run the unit test, you need to compile sfntly first, then copy 9 | Tuffy.ttf from data/ext to the folder that unit\_test(.exe) is located. 10 | Run the unit\_test. 11 | 12 | If you are only interested in one test case, for example, you are 13 | working on name table and only wants name editing test, you can use the 14 | gtest\_filter flag in command line. 15 | 16 | ``` {.prettyprint} 17 | unit_test --gtest_filter=NameEditing.* 18 | ``` 19 | 20 | For more info regarding running a subset of gtest, please see [GTest 21 | Advanced 22 | Guide](http://code.google.com/p/googletest/wiki/V1_6_AdvancedGuide). 23 | 24 | Its strongly suggested to run unit\_tests with valgrind. The following 25 | example shows a typical test command 26 | 27 | ``` {.prettyprint} 28 | valgrind --leak-check=full -v ./unit_test --gtest_filter=*.*-FontData.* 29 | ``` 30 | 31 | FontData tests are the longest and you may want to bypass them during 32 | development. They shall be run in bots, however. 33 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/data/SfObjects.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.sfntly.data; 2 | 3 | import java.util.Arrays; 4 | 5 | public class SfObjects { 6 | 7 | /** Same as Object.equals from Java 7. */ 8 | public static boolean equals(Object a, Object b) { 9 | return (a == b) || (a != null && a.equals(b)); 10 | } 11 | 12 | /** Same as Objects.hash from Java 7. */ 13 | public static int hash(Object... values) { 14 | return Arrays.hashCode(values); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/data/SfStringUtils.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.sfntly.data; 2 | 3 | import java.util.HashSet; 4 | import java.util.Set; 5 | 6 | public final class SfStringUtils { 7 | 8 | public static Set getAllCodepoints(String s) { 9 | Set list = new HashSet<>(); 10 | for (int cp, i = 0, len = s.length(); i < len; i += Character.charCount(cp)) { 11 | cp = s.codePointAt(i); 12 | list.add(cp); 13 | } 14 | return list; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/math/Fixed1616.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.typography.font.sfntly.math; 18 | 19 | /** 20 | * Fixed 16.16 integer utilities. 21 | * 22 | * @author Stuart Gill 23 | */ 24 | public enum Fixed1616 { 25 | ; 26 | 27 | public static int integral(int fixed) { 28 | return (fixed >> 16) & 0xffff; 29 | } 30 | 31 | public static int fractional(int fixed) { 32 | return fixed & 0xffff; 33 | } 34 | 35 | public static int fixed(int integral, int fractional) { 36 | return ((integral & 0xffff) << 16) | (fractional & 0xffff); 37 | } 38 | 39 | /** 40 | * @param fixed the number to convert 41 | * @return a double representing the 16-16 floating point number 42 | */ 43 | public static double doubleValue(int fixed) { 44 | return fixed / 65536.0; // shift the decimal 16 bits 45 | } 46 | 47 | public static String toString(int fixed) { 48 | return String.format("%d.%d", integral(fixed), fractional(fixed)); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/math/FontMath.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.typography.font.sfntly.math; 18 | 19 | /** 20 | * Utility math for fonts. 21 | * 22 | * @author Stuart Gill 23 | */ 24 | public enum FontMath { 25 | ; 26 | 27 | public static int log2(int a) { 28 | return 31 - Integer.numberOfLeadingZeros(a); 29 | } 30 | 31 | /** 32 | * Calculates the amount of padding needed. The values provided need to be in the same units. So, 33 | * if the size is given as the number of bytes then the alignment size must also be specified as 34 | * byte size to align to. 35 | * 36 | * @param size the size of the data that may need padding 37 | * @param alignmentSize the number of units to align to 38 | * @return the number of units needing to be added for alignment 39 | */ 40 | public static int paddingRequired(int size, int alignmentSize) { 41 | int padding = alignmentSize - (size % alignmentSize); 42 | return padding == alignmentSize ? 0 : padding; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/sample/build.properties: -------------------------------------------------------------------------------- 1 | src.dir=../../../../../../../src 2 | lib.dir=../../../../../../../lib 3 | build.dir=../../../../../../../build 4 | classes.dir=../../../../../../../build/classes 5 | dist_lib.dir=../../../../../../../dist/lib 6 | dist_sflint.dir=../../../../../../../dist/sample/sflint 7 | dist_sfntdump.dir=../../../../../../../dist/sample/sfntdump 8 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/sample/sfview/GsubRulesDump.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.sfntly.sample.sfview; 2 | 3 | import com.google.typography.font.sfntly.Font; 4 | import com.google.typography.font.sfntly.FontFactory; 5 | import com.google.typography.font.sfntly.Tag; 6 | import com.google.typography.font.sfntly.table.core.PostScriptTable; 7 | import com.google.typography.font.sfntly.table.opentype.component.GlyphGroup; 8 | import com.google.typography.font.sfntly.table.opentype.component.Rule; 9 | import java.io.File; 10 | import java.io.FileInputStream; 11 | import java.io.FileNotFoundException; 12 | import java.io.IOException; 13 | 14 | public class GsubRulesDump { 15 | public static void main(String[] args) throws IOException { 16 | String fontName = args[0]; 17 | String txt = args[1]; 18 | 19 | System.out.println("Rules from font: " + fontName); 20 | Font[] fonts = loadFont(new File(fontName)); 21 | if (fonts == null) { 22 | throw new IllegalArgumentException("No font found"); 23 | } 24 | 25 | Font font = fonts[0]; 26 | GlyphGroup ruleClosure = Rule.charGlyphClosure(font, txt); 27 | PostScriptTable post = font.getTable(Tag.post); 28 | Rule.dumpLookups(font); 29 | System.out.println("Closure: " + ruleClosure.toString(post)); 30 | } 31 | 32 | private static Font[] loadFont(File file) throws IOException { 33 | FontFactory fontFactory = FontFactory.getInstance(); 34 | fontFactory.fingerprintFont(true); 35 | try (FileInputStream is = new FileInputStream(file)) { 36 | return fontFactory.loadFonts(is); 37 | } catch (FileNotFoundException e) { 38 | System.err.println("Could not load the font: " + file.getName()); 39 | return null; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/sample/sfview/RuleDump.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.sfntly.sample.sfview; 2 | 3 | import com.google.typography.font.sfntly.Font; 4 | import com.google.typography.font.sfntly.FontFactory; 5 | import com.google.typography.font.sfntly.table.opentype.component.GlyphGroup; 6 | import com.google.typography.font.sfntly.table.opentype.component.Rule; 7 | import java.io.File; 8 | import java.io.FileInputStream; 9 | import java.io.FileNotFoundException; 10 | import java.io.IOException; 11 | 12 | public class RuleDump { 13 | public static void main(String[] args) throws IOException { 14 | 15 | String fontName = args[0]; 16 | String txt = args[1]; 17 | 18 | System.out.println("Rules from font: " + fontName); 19 | Font[] fonts = loadFont(new File(fontName)); 20 | if (fonts == null) { 21 | throw new IllegalArgumentException("No font found"); 22 | } 23 | 24 | Font font = fonts[0]; 25 | GlyphGroup ruleClosure = Rule.charGlyphClosure(font, txt); 26 | } 27 | 28 | public static Font[] loadFont(File file) throws IOException { 29 | FontFactory fontFactory = FontFactory.getInstance(); 30 | fontFactory.fingerprintFont(true); 31 | try (FileInputStream is = new FileInputStream(file)) { 32 | return fontFactory.loadFonts(is); 33 | } catch (FileNotFoundException e) { 34 | System.err.println("Could not load the font: " + file.getName()); 35 | return null; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/sample/sfview/SFView.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.sfntly.sample.sfview; 2 | 3 | import com.google.typography.font.sfntly.Font; 4 | import com.google.typography.font.sfntly.FontFactory; 5 | import java.io.File; 6 | import java.io.FileInputStream; 7 | import java.io.FileNotFoundException; 8 | import java.io.IOException; 9 | import javax.swing.JFrame; 10 | import javax.swing.JScrollPane; 11 | 12 | public class SFView { 13 | public static void main(String[] args) throws IOException { 14 | for (String fontName : args) { 15 | System.out.println("Displaying font: " + fontName); 16 | Font[] fonts = loadFont(new File(fontName)); 17 | if (fonts == null) { 18 | continue; 19 | } 20 | for (Font font : fonts) { 21 | JFrame jf = new JFrame("Sfntly Table Viewer"); 22 | jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 23 | SFFontView view = new SFFontView(font); 24 | JScrollPane sp = new JScrollPane(view); 25 | jf.add(sp); 26 | jf.pack(); 27 | jf.setVisible(true); 28 | } 29 | } 30 | } 31 | 32 | private static Font[] loadFont(File file) throws IOException { 33 | FontFactory fontFactory = FontFactory.getInstance(); 34 | fontFactory.fingerprintFont(true); 35 | try { 36 | try (FileInputStream is = new FileInputStream(file)) { 37 | return fontFactory.loadFonts(is); 38 | } 39 | } catch (FileNotFoundException e) { 40 | System.err.println("Could not load the font: " + file.getName()); 41 | return null; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/sample/sfview/TaggedData.java: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Google Inc. All Rights Reserved. 2 | 3 | package com.google.typography.font.sfntly.sample.sfview; 4 | 5 | import com.google.typography.font.sfntly.data.ReadableFontData; 6 | 7 | /** @author dougfelt@google.com (Doug Felt) */ 8 | interface TaggedData { 9 | /** 10 | * @param string label 11 | * @param start start of range to tag 12 | * @param length length of range to tag 13 | * @param depth nesting depth of range 14 | */ 15 | void tagRange(String string, int start, int length, int depth); 16 | 17 | /** 18 | * @param position the position of the field 19 | * @param width number of bytes for the field at position 20 | * @param value the value in those bytes 21 | * @param alt an alternate presentation of the value (in decimal, a tag) 22 | * @param label the label of this field 23 | */ 24 | void tagField(int position, int width, int value, String alt, String label); 25 | 26 | /** 27 | * @param position the position of the reference to target 28 | * @param value the raw value of the field 29 | * @param targetPosition the target position; 30 | * @param label name for this reference, or null 31 | */ 32 | void tagTarget(int position, int value, int targetPosition, String label); 33 | 34 | void pushRange(String string, ReadableFontData data); 35 | 36 | void pushRangeAtOffset(String label, int base); 37 | 38 | int tagRangeField(FieldType ft, String label); 39 | 40 | void setRangePosition(int rangePosition); 41 | 42 | void popRange(); 43 | 44 | static enum FieldType { 45 | TAG, 46 | SHORT, 47 | SHORT_IGNORED, 48 | SHORT_IGNORED_FFFF, 49 | OFFSET, 50 | OFFSET_NONZERO, 51 | OFFSET32, 52 | GLYPH; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/sample/sfview/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This package contain, the font display tool SFView to display the GSUB sub-tables and there 3 | * interdependencies. This is an experimental package. Please treat this code as an alpha code. 4 | * 5 | * @author Cibu Johny 6 | */ 7 | package com.google.typography.font.sfntly.sample.sfview; 8 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/table/GenericTableBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.typography.font.sfntly.table; 17 | 18 | import com.google.typography.font.sfntly.data.ReadableFontData; 19 | import com.google.typography.font.sfntly.data.WritableFontData; 20 | 21 | /** 22 | * A table builder to do the minimal table building for an unknown table type. 23 | * 24 | * @author Stuart Gill 25 | */ 26 | final class GenericTableBuilder extends TableBasedTableBuilder { 27 | 28 | static GenericTableBuilder createBuilder(Header header, WritableFontData data) { 29 | return new GenericTableBuilder(header, data); 30 | } 31 | 32 | private GenericTableBuilder(Header header, WritableFontData data) { 33 | super(header, data); 34 | } 35 | 36 | private GenericTableBuilder(Header header, ReadableFontData data) { 37 | super(header, data); 38 | } 39 | 40 | @Override 41 | protected Table subBuildTable(ReadableFontData data) { 42 | return new Table(header(), internalReadData()); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/table/SubTableContainerTable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.typography.font.sfntly.table; 18 | 19 | import com.google.typography.font.sfntly.data.ReadableFontData; 20 | import com.google.typography.font.sfntly.data.WritableFontData; 21 | 22 | /** 23 | * A table that contains subtables. 24 | * 25 | * @author Stuart Gill 26 | */ 27 | public abstract class SubTableContainerTable extends Table { 28 | 29 | protected SubTableContainerTable(Header header, ReadableFontData data) { 30 | super(header, data); 31 | } 32 | 33 | public abstract static class Builder extends Table.Builder { 34 | 35 | protected Builder(Header header, WritableFontData data) { 36 | super(header, data); 37 | } 38 | 39 | protected Builder(Header header, ReadableFontData data) { 40 | super(header, data); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/table/bitmap/GlyphMetrics.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.typography.font.sfntly.table.bitmap; 18 | 19 | import com.google.typography.font.sfntly.data.ReadableFontData; 20 | import com.google.typography.font.sfntly.data.WritableFontData; 21 | import com.google.typography.font.sfntly.table.SubTable; 22 | 23 | /** @author Stuart Gill */ 24 | abstract class GlyphMetrics extends SubTable { 25 | 26 | protected GlyphMetrics(ReadableFontData data) { 27 | super(data); 28 | } 29 | 30 | abstract static class Builder extends SubTable.Builder { 31 | /** @param data the data for the subtable being built */ 32 | protected Builder(WritableFontData data) { 33 | super(data); 34 | } 35 | 36 | /** @param data the data for the subtable being built */ 37 | protected Builder(ReadableFontData data) { 38 | super(data); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/table/bitmap/SimpleBitmapGlyph.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.typography.font.sfntly.table.bitmap; 18 | 19 | import com.google.typography.font.sfntly.data.ReadableFontData; 20 | import com.google.typography.font.sfntly.data.WritableFontData; 21 | 22 | /** @author Stuart Gill */ 23 | public final class SimpleBitmapGlyph extends BitmapGlyph { 24 | 25 | protected SimpleBitmapGlyph(ReadableFontData data, int format) { 26 | super(data, format); 27 | } 28 | 29 | public static class Builder extends BitmapGlyph.Builder { 30 | 31 | protected Builder(WritableFontData data, int format) { 32 | super(data, format); 33 | } 34 | 35 | protected Builder(ReadableFontData data, int format) { 36 | super(data, format); 37 | } 38 | 39 | @Override 40 | protected SimpleBitmapGlyph subBuildTable(ReadableFontData data) { 41 | return new SimpleBitmapGlyph(data, format()); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/table/opentype/AlternateSubst.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.sfntly.table.opentype; 2 | 3 | import com.google.typography.font.sfntly.data.ReadableFontData; 4 | import com.google.typography.font.sfntly.table.opentype.component.OneToManySubst; 5 | 6 | public class AlternateSubst extends OneToManySubst { 7 | AlternateSubst(ReadableFontData data, int base, boolean dataIsCanonical) { 8 | super(data, base, dataIsCanonical); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/table/opentype/GsubLookupSubTable.java: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Google Inc. All Rights Reserved. 2 | 3 | package com.google.typography.font.sfntly.table.opentype; 4 | 5 | import com.google.typography.font.sfntly.data.ReadableFontData; 6 | import com.google.typography.font.sfntly.table.opentype.component.GsubLookupType; 7 | 8 | /** @author dougfelt@google.com (Doug Felt) */ 9 | abstract class GsubLookupSubTable extends LookupSubTable { 10 | 11 | protected GsubLookupSubTable(ReadableFontData data, boolean dataIsCanonical) { 12 | super(data, dataIsCanonical); 13 | } 14 | 15 | @Override 16 | public abstract Builder builder(); 17 | 18 | @Override 19 | public abstract GsubLookupType lookupType(); 20 | 21 | abstract static class Builder extends LookupSubTable.Builder { 22 | 23 | protected Builder(ReadableFontData data, boolean dataIsCanonical) { 24 | super(data, dataIsCanonical); 25 | } 26 | 27 | protected Builder(T table) { 28 | super(table); 29 | } 30 | 31 | @Override 32 | public abstract GsubLookupType lookupType(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/table/opentype/GsubLookupTable.java: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Google Inc. All Rights Reserved. 2 | 3 | package com.google.typography.font.sfntly.table.opentype; 4 | 5 | import com.google.typography.font.sfntly.data.ReadableFontData; 6 | 7 | /** @author dougfelt@google.com (Doug Felt) */ 8 | abstract class GsubLookupTable extends LookupTable { 9 | 10 | protected GsubLookupTable(ReadableFontData data, int base, boolean dataIsCanonical) { 11 | super(data, base, dataIsCanonical); 12 | } 13 | 14 | abstract static class Builder extends LookupTable.Builder { 15 | 16 | protected Builder(ReadableFontData data, boolean dataIsCanonical) { 17 | super(data, dataIsCanonical); 18 | } 19 | 20 | protected Builder() {} 21 | 22 | protected Builder(T table) { 23 | super(table); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/table/opentype/LookupSubTable.java: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Google Inc. All Rights Reserved. 2 | 3 | package com.google.typography.font.sfntly.table.opentype; 4 | 5 | import com.google.typography.font.sfntly.data.ReadableFontData; 6 | import com.google.typography.font.sfntly.table.opentype.component.LookupType; 7 | 8 | abstract class LookupSubTable extends OTSubTable { 9 | 10 | protected LookupSubTable(ReadableFontData data, boolean dataIsCanonical) { 11 | super(data, dataIsCanonical); 12 | } 13 | 14 | // @Override 15 | // private abstract Builder builder(); 16 | 17 | protected abstract LookupType lookupType(); 18 | 19 | abstract static class Builder extends OTSubTable.Builder { 20 | 21 | protected Builder(ReadableFontData data, boolean dataIsCanonical) { 22 | super(data, dataIsCanonical); 23 | } 24 | 25 | protected Builder(T table) { 26 | super(table); 27 | } 28 | 29 | protected abstract LookupType lookupType(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/table/opentype/MultipleSubst.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.sfntly.table.opentype; 2 | 3 | import com.google.typography.font.sfntly.data.ReadableFontData; 4 | import com.google.typography.font.sfntly.table.opentype.component.OneToManySubst; 5 | 6 | public class MultipleSubst extends OneToManySubst { 7 | MultipleSubst(ReadableFontData data, int base, boolean dataIsCanonical) { 8 | super(data, base, dataIsCanonical); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/table/opentype/NullTable.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.sfntly.table.opentype; 2 | 3 | import com.google.typography.font.sfntly.data.ReadableFontData; 4 | import com.google.typography.font.sfntly.data.WritableFontData; 5 | import com.google.typography.font.sfntly.table.opentype.component.VisibleSubTable; 6 | 7 | public final class NullTable extends SubstSubtable { 8 | private static final int RECORD_SIZE = 0; 9 | 10 | NullTable(ReadableFontData data, int base, boolean dataIsCanonical) { 11 | super(data, base, dataIsCanonical); 12 | } 13 | 14 | private NullTable(ReadableFontData data) { 15 | super(data, 0, false); 16 | } 17 | 18 | private NullTable() { 19 | super(null, 0, false); 20 | } 21 | 22 | public static final class Builder extends VisibleSubTable.Builder { 23 | private Builder() {} 24 | 25 | private Builder(ReadableFontData data, boolean dataIsCanonical) {} 26 | 27 | private Builder(NullTable table) {} 28 | 29 | @Override 30 | public int subDataSizeToSerialize() { 31 | return RECORD_SIZE; 32 | } 33 | 34 | @Override 35 | public int subSerialize(WritableFontData newData) { 36 | return RECORD_SIZE; 37 | } 38 | 39 | @Override 40 | public NullTable subBuildTable(ReadableFontData data) { 41 | return new NullTable(data); 42 | } 43 | 44 | @Override 45 | public void subDataSet() {} 46 | 47 | @Override 48 | protected boolean subReadyToSerialize() { 49 | return true; 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/table/opentype/SubstSubtable.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.sfntly.table.opentype; 2 | 3 | import com.google.typography.font.sfntly.data.ReadableFontData; 4 | import com.google.typography.font.sfntly.table.opentype.component.HeaderTable; 5 | 6 | public abstract class SubstSubtable extends HeaderTable { 7 | private static final int FIELD_COUNT = 1; 8 | private static final int FORMAT_INDEX = 0; 9 | private static final int FORMAT_DEFAULT = 0; 10 | public final int format; 11 | 12 | protected SubstSubtable(ReadableFontData data, int base, boolean dataIsCanonical) { 13 | super(data, base, dataIsCanonical); 14 | format = getField(FORMAT_INDEX); 15 | } 16 | 17 | @Override 18 | public int fieldCount() { 19 | return FIELD_COUNT; 20 | } 21 | 22 | public abstract static class Builder extends HeaderTable.Builder { 23 | protected int format; 24 | 25 | protected Builder(ReadableFontData data, boolean dataIsCanonical) { 26 | super(data); 27 | format = getField(FORMAT_INDEX); 28 | } 29 | 30 | protected Builder() { 31 | super(); 32 | } 33 | 34 | @Override 35 | protected void initFields() { 36 | setField(FORMAT_INDEX, FORMAT_DEFAULT); 37 | } 38 | 39 | @Override 40 | public int fieldCount() { 41 | return FIELD_COUNT; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/table/opentype/TaggedData.java: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Google Inc. All Rights Reserved. 2 | 3 | package com.google.typography.font.sfntly.table.opentype; 4 | 5 | import com.google.typography.font.sfntly.data.ReadableFontData; 6 | 7 | /** @author dougfelt@google.com (Doug Felt) */ 8 | public interface TaggedData { 9 | void tagRange(String label, int start, int length, int nestingDepth); 10 | 11 | /** 12 | * @param width number of bytes for the field at position 13 | * @param value the value in those bytes 14 | * @param alt an alternate presentation of the value (in decimal, a tag) 15 | */ 16 | void tagField(int position, int width, int value, String alt, String label); 17 | 18 | /** 19 | * @param position the position of the reference to target 20 | * @param value the raw value of the field 21 | * @param targetPosition the target position; 22 | * @param label name for this reference, or null 23 | */ 24 | void tagTarget(int position, int value, int targetPosition, String label); 25 | 26 | void pushRange(String label, ReadableFontData data); 27 | 28 | void pushRangeAtOffset(String label, int base); 29 | 30 | int tagRangeField(FieldType ft, String label); 31 | 32 | void setRangePosition(int rangePosition); 33 | 34 | void popRange(); 35 | 36 | static enum FieldType { 37 | TAG, 38 | SHORT, 39 | SHORT_IGNORED, 40 | SHORT_IGNORED_FFFF, 41 | OFFSET, 42 | OFFSET_NONZERO, 43 | OFFSET32, 44 | GLYPH; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/table/opentype/chaincontextsubst/ChainSubClassRule.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.sfntly.table.opentype.chaincontextsubst; 2 | 3 | import com.google.typography.font.sfntly.data.ReadableFontData; 4 | 5 | public class ChainSubClassRule extends ChainSubGenericRule { 6 | ChainSubClassRule(ReadableFontData data, int base, boolean dataIsCanonical) { 7 | super(data, base, dataIsCanonical); 8 | } 9 | 10 | static class Builder extends ChainSubGenericRule.Builder { 11 | Builder() { 12 | super(); 13 | } 14 | 15 | Builder(ChainSubClassRule table) { 16 | super(table); 17 | } 18 | 19 | Builder(ReadableFontData data, int base, boolean dataIsCanonical) { 20 | super(data, base, dataIsCanonical); 21 | } 22 | 23 | @Override 24 | public ChainSubClassRule subBuildTable(ReadableFontData data) { 25 | return new ChainSubClassRule(data, 0, true); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/table/opentype/chaincontextsubst/ChainSubGenericRuleSet.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.sfntly.table.opentype.chaincontextsubst; 2 | 3 | import com.google.typography.font.sfntly.data.ReadableFontData; 4 | import com.google.typography.font.sfntly.table.opentype.component.OffsetRecordTable; 5 | 6 | public abstract class ChainSubGenericRuleSet 7 | extends OffsetRecordTable { 8 | protected ChainSubGenericRuleSet(ReadableFontData data, int base, boolean dataIsCanonical) { 9 | super(data, base, dataIsCanonical); 10 | } 11 | 12 | @Override 13 | public int fieldCount() { 14 | return 0; 15 | } 16 | 17 | abstract static class Builder, S extends ChainSubGenericRule> 18 | extends OffsetRecordTable.Builder { 19 | 20 | protected Builder(ReadableFontData data, boolean dataIsCanonical) { 21 | super(data, dataIsCanonical); 22 | } 23 | 24 | protected Builder() { 25 | super(); 26 | } 27 | 28 | protected Builder(T table) { 29 | super(table); 30 | } 31 | 32 | @Override 33 | protected void initFields() {} 34 | 35 | @Override 36 | public int fieldCount() { 37 | return 0; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/table/opentype/chaincontextsubst/ChainSubRule.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.sfntly.table.opentype.chaincontextsubst; 2 | 3 | import com.google.typography.font.sfntly.data.ReadableFontData; 4 | 5 | public class ChainSubRule extends ChainSubGenericRule { 6 | ChainSubRule(ReadableFontData data, int base, boolean dataIsCanonical) { 7 | super(data, base, dataIsCanonical); 8 | } 9 | 10 | static class Builder extends ChainSubGenericRule.Builder { 11 | Builder() { 12 | super(); 13 | } 14 | 15 | Builder(ChainSubRule table) { 16 | super(table); 17 | } 18 | 19 | Builder(ReadableFontData data, int base, boolean dataIsCanonical) { 20 | super(data, base, dataIsCanonical); 21 | } 22 | 23 | @Override 24 | public ChainSubRule subBuildTable(ReadableFontData data) { 25 | return new ChainSubRule(data, 0, true); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/table/opentype/component/GlyphClassList.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.sfntly.table.opentype.component; 2 | 3 | import com.google.typography.font.sfntly.data.ReadableFontData; 4 | import com.google.typography.font.sfntly.data.WritableFontData; 5 | 6 | public class GlyphClassList extends NumRecordList { 7 | private GlyphClassList(WritableFontData data) { 8 | super(data); 9 | } 10 | 11 | private GlyphClassList(ReadableFontData data) { 12 | super(data); 13 | } 14 | 15 | private GlyphClassList(ReadableFontData data, int countDecrement) { 16 | super(data, countDecrement); 17 | } 18 | 19 | private GlyphClassList( 20 | ReadableFontData data, int countDecrement, int countOffset, int valuesOffset) { 21 | super(data, countDecrement, countOffset, valuesOffset); 22 | } 23 | 24 | public GlyphClassList(NumRecordList other) { 25 | super(other); 26 | } 27 | 28 | public static int sizeOfListOfCount(int count) { 29 | return RecordList.DATA_OFFSET + count * NumRecord.RECORD_SIZE; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/table/opentype/component/GlyphList.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.sfntly.table.opentype.component; 2 | 3 | import java.util.ArrayList; 4 | 5 | class GlyphList extends ArrayList { 6 | private static final long serialVersionUID = 4699092062720505377L; 7 | 8 | GlyphList() { 9 | super(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/table/opentype/component/GsubLookupType.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.sfntly.table.opentype.component; 2 | 3 | public enum GsubLookupType implements LookupType { 4 | GSUB_SINGLE, 5 | GSUB_MULTIPLE, 6 | GSUB_ALTERNATE, 7 | GSUB_LIGATURE, 8 | GSUB_CONTEXTUAL, 9 | GSUB_CHAINING_CONTEXTUAL, 10 | GSUB_EXTENSION, 11 | GSUB_REVERSE_CHAINING_CONTEXTUAL_SINGLE; 12 | 13 | @Override 14 | public int typeNum() { 15 | return ordinal() + 1; 16 | } 17 | 18 | @Override 19 | public String toString() { 20 | return super.toString().toLowerCase(); 21 | } 22 | 23 | public static GsubLookupType forTypeNum(int typeNum) { 24 | if (typeNum <= 0 || typeNum > values.length) { 25 | System.err.format("unknown gsub lookup typeNum: %d\n", typeNum); 26 | return null; 27 | } 28 | return values[typeNum - 1]; 29 | } 30 | 31 | private static final GsubLookupType[] values = values(); 32 | } 33 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/table/opentype/component/LookupFlag.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.sfntly.table.opentype.component; 2 | 3 | enum LookupFlag { 4 | RIGHT_TO_LEFT(1), 5 | IGNORE_BASE_GLYPHS(2), 6 | IGNORE_LIGATURES(4), 7 | IGNORE_MARKS(8); 8 | 9 | boolean isSet(int flags) { 10 | return isFlagSet(flags, mask); 11 | } 12 | 13 | int set(int flags) { 14 | return setFlag(flags, mask); 15 | } 16 | 17 | int clear(int flags) { 18 | return clearFlag(flags, mask); 19 | } 20 | 21 | private final int mask; 22 | 23 | private LookupFlag(int mask) { 24 | this.mask = mask; 25 | } 26 | 27 | static boolean isFlagSet(int flags, int mask) { 28 | return (flags & mask) != 0; 29 | } 30 | 31 | static int setFlag(int flags, int mask) { 32 | return flags | mask; 33 | } 34 | 35 | static int clearFlag(int flags, int mask) { 36 | return flags & ~mask; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/table/opentype/component/LookupType.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.sfntly.table.opentype.component; 2 | 3 | public interface LookupType { 4 | int typeNum(); 5 | } 6 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/table/opentype/component/NumRecord.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.sfntly.table.opentype.component; 2 | 3 | import com.google.typography.font.sfntly.data.ReadableFontData; 4 | import com.google.typography.font.sfntly.data.WritableFontData; 5 | 6 | public final class NumRecord implements Record { 7 | static final int RECORD_SIZE = 2; 8 | private static final int TAG_POS = 0; 9 | final int value; 10 | 11 | NumRecord(ReadableFontData data, int base) { 12 | this.value = data.readUShort(base + TAG_POS); 13 | } 14 | 15 | public NumRecord(int num) { 16 | this.value = num; 17 | } 18 | 19 | @Override 20 | public int writeTo(WritableFontData newData, int base) { 21 | newData.writeUShort(base + TAG_POS, value); 22 | return RECORD_SIZE; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/table/opentype/component/NumRecordList.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.sfntly.table.opentype.component; 2 | 3 | import com.google.typography.font.sfntly.data.ReadableFontData; 4 | import com.google.typography.font.sfntly.data.WritableFontData; 5 | 6 | public class NumRecordList extends RecordList { 7 | public NumRecordList(WritableFontData data) { 8 | super(data); 9 | } 10 | 11 | public NumRecordList(ReadableFontData data) { 12 | super(data); 13 | } 14 | 15 | public NumRecordList(ReadableFontData data, int countDecrement) { 16 | super(data, countDecrement); 17 | } 18 | 19 | public NumRecordList(ReadableFontData data, int countDecrement, int countOffset) { 20 | super(data, countDecrement, countOffset); 21 | } 22 | 23 | public NumRecordList( 24 | ReadableFontData data, int countDecrement, int countOffset, int valuesOffset) { 25 | super(data, countDecrement, countOffset, valuesOffset); 26 | } 27 | 28 | public NumRecordList(NumRecordList other) { 29 | super(other); 30 | } 31 | 32 | public static int sizeOfListOfCount(int count) { 33 | return RecordList.DATA_OFFSET + count * NumRecord.RECORD_SIZE; 34 | } 35 | 36 | public boolean contains(int value) { 37 | for (NumRecord record : this) { 38 | if (record.value == value) { 39 | return true; 40 | } 41 | } 42 | return false; 43 | } 44 | 45 | @Override 46 | protected NumRecord getRecordAt(ReadableFontData data, int offset) { 47 | return new NumRecord(data, offset); 48 | } 49 | 50 | @Override 51 | protected int recordSize() { 52 | return NumRecord.RECORD_SIZE; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/table/opentype/component/RangeRecord.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.sfntly.table.opentype.component; 2 | 3 | import com.google.typography.font.sfntly.data.ReadableFontData; 4 | import com.google.typography.font.sfntly.data.WritableFontData; 5 | 6 | final class RangeRecord implements Record { 7 | static final int RECORD_SIZE = 6; 8 | private static final int START_OFFSET = 0; 9 | private static final int END_OFFSET = 2; 10 | private static final int PROPERTY_OFFSET = 4; 11 | final int start; 12 | final int end; 13 | final int property; 14 | 15 | RangeRecord(ReadableFontData data, int base) { 16 | this.start = data.readUShort(base + START_OFFSET); 17 | this.end = data.readUShort(base + END_OFFSET); 18 | this.property = data.readUShort(base + PROPERTY_OFFSET); 19 | } 20 | 21 | @Override 22 | public int writeTo(WritableFontData newData, int base) { 23 | newData.writeUShort(base + START_OFFSET, start); 24 | newData.writeUShort(base + END_OFFSET, end); 25 | return RECORD_SIZE; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/table/opentype/component/RangeRecordList.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.sfntly.table.opentype.component; 2 | 3 | import com.google.typography.font.sfntly.data.ReadableFontData; 4 | import com.google.typography.font.sfntly.data.WritableFontData; 5 | 6 | public final class RangeRecordList extends RecordList { 7 | public RangeRecordList(WritableFontData data) { 8 | super(data); 9 | } 10 | 11 | public RangeRecordList(ReadableFontData data) { 12 | super(data); 13 | } 14 | 15 | public static int sizeOfListOfCount(int count) { 16 | return RecordList.DATA_OFFSET + count * RangeRecord.RECORD_SIZE; 17 | } 18 | 19 | @Override 20 | protected RangeRecord getRecordAt(ReadableFontData data, int offset) { 21 | return new RangeRecord(data, offset); 22 | } 23 | 24 | @Override 25 | protected int recordSize() { 26 | return RangeRecord.RECORD_SIZE; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/table/opentype/component/RangeRecordTable.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.sfntly.table.opentype.component; 2 | 3 | import com.google.typography.font.sfntly.data.ReadableFontData; 4 | 5 | public class RangeRecordTable extends RecordsTable { 6 | public RangeRecordTable(ReadableFontData data, int base, boolean dataIsCanonical) { 7 | super(data, base, dataIsCanonical); 8 | } 9 | 10 | @Override 11 | protected RecordList createRecordList(ReadableFontData data) { 12 | return new RangeRecordList(data); 13 | } 14 | 15 | @Override 16 | public int fieldCount() { 17 | return 0; 18 | } 19 | 20 | public static class Builder extends RecordsTable.Builder { 21 | public Builder(ReadableFontData data, int base, boolean dataIsCanonical) { 22 | super(data, base, dataIsCanonical); 23 | } 24 | 25 | @Override 26 | protected RangeRecordTable readTable(ReadableFontData data, int base, boolean dataIsCanonical) { 27 | if (base != 0) { 28 | throw new UnsupportedOperationException(); 29 | } 30 | return new RangeRecordTable(data, base, dataIsCanonical); 31 | } 32 | 33 | @Override 34 | protected RecordList readRecordList(ReadableFontData data, int base) { 35 | if (base != 0) { 36 | throw new UnsupportedOperationException(); 37 | } 38 | return new RangeRecordList(data); 39 | } 40 | 41 | @Override 42 | protected int fieldCount() { 43 | return 0; 44 | } 45 | 46 | @Override 47 | protected void initFields() {} 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/table/opentype/component/Record.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.sfntly.table.opentype.component; 2 | 3 | import com.google.typography.font.sfntly.data.WritableFontData; 4 | 5 | interface Record { 6 | int writeTo(WritableFontData newData, int base); 7 | } 8 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/table/opentype/component/SubstLookupRecord.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.sfntly.table.opentype.component; 2 | 3 | import com.google.typography.font.sfntly.data.ReadableFontData; 4 | import com.google.typography.font.sfntly.data.WritableFontData; 5 | 6 | final class SubstLookupRecord implements Record { 7 | static final int RECORD_SIZE = 4; 8 | private static final int SEQUENCE_INDEX_OFFSET = 0; 9 | private static final int LOOKUP_LIST_INDEX_OFFSET = 2; 10 | final int sequenceIndex; 11 | final int lookupListIndex; 12 | 13 | SubstLookupRecord(ReadableFontData data, int base) { 14 | this.sequenceIndex = data.readUShort(base + SEQUENCE_INDEX_OFFSET); 15 | this.lookupListIndex = data.readUShort(base + LOOKUP_LIST_INDEX_OFFSET); 16 | } 17 | 18 | @Override 19 | public int writeTo(WritableFontData newData, int base) { 20 | newData.writeUShort(base + SEQUENCE_INDEX_OFFSET, sequenceIndex); 21 | newData.writeUShort(base + LOOKUP_LIST_INDEX_OFFSET, lookupListIndex); 22 | return RECORD_SIZE; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/table/opentype/component/SubstLookupRecordList.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.sfntly.table.opentype.component; 2 | 3 | import com.google.typography.font.sfntly.data.ReadableFontData; 4 | import com.google.typography.font.sfntly.data.WritableFontData; 5 | 6 | public final class SubstLookupRecordList extends RecordList { 7 | private SubstLookupRecordList(WritableFontData data) { 8 | super(data); 9 | } 10 | 11 | public SubstLookupRecordList(ReadableFontData data, int base) { 12 | super(data, 0, base); 13 | } 14 | 15 | public SubstLookupRecordList(ReadableFontData data, int countOffset, int valuesOffset) { 16 | super(data, 0, countOffset, valuesOffset); 17 | } 18 | 19 | @Override 20 | protected SubstLookupRecord getRecordAt(ReadableFontData data, int offset) { 21 | return new SubstLookupRecord(data, offset); 22 | } 23 | 24 | @Override 25 | protected int recordSize() { 26 | return SubstLookupRecord.RECORD_SIZE; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/table/opentype/component/TagOffsetRecord.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.sfntly.table.opentype.component; 2 | 3 | import com.google.typography.font.sfntly.data.ReadableFontData; 4 | import com.google.typography.font.sfntly.data.WritableFontData; 5 | 6 | final class TagOffsetRecord implements Record { 7 | static final int RECORD_SIZE = 6; 8 | private static final int TAG_POS = 0; 9 | private static final int OFFSET_POS = 4; 10 | final int tag; 11 | final int offset; 12 | 13 | TagOffsetRecord(ReadableFontData data, int base) { 14 | this.tag = data.readULongAsInt(base + TAG_POS); 15 | this.offset = data.readUShort(base + OFFSET_POS); 16 | } 17 | 18 | TagOffsetRecord(int tag, int offset) { 19 | this.tag = tag; 20 | this.offset = offset; 21 | } 22 | 23 | @Override 24 | public int writeTo(WritableFontData newData, int base) { 25 | newData.writeULong(base + TAG_POS, tag); 26 | newData.writeUShort(base + OFFSET_POS, offset); 27 | return RECORD_SIZE; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/table/opentype/component/TagOffsetRecordList.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.sfntly.table.opentype.component; 2 | 3 | import com.google.typography.font.sfntly.data.ReadableFontData; 4 | import com.google.typography.font.sfntly.data.WritableFontData; 5 | 6 | final class TagOffsetRecordList extends RecordList { 7 | TagOffsetRecordList(WritableFontData data) { 8 | super(data); 9 | } 10 | 11 | TagOffsetRecordList(ReadableFontData data) { 12 | super(data); 13 | } 14 | 15 | static int sizeOfListOfCount(int count) { 16 | return RecordList.DATA_OFFSET + count * TagOffsetRecord.RECORD_SIZE; 17 | } 18 | 19 | TagOffsetRecord getRecordForTag(int tag) { 20 | for (TagOffsetRecord record : this) { 21 | if (record.tag == tag) { 22 | return record; 23 | } 24 | } 25 | return null; 26 | } 27 | 28 | @Override 29 | protected TagOffsetRecord getRecordAt(ReadableFontData data, int offset) { 30 | return new TagOffsetRecord(data, offset); 31 | } 32 | 33 | @Override 34 | protected int recordSize() { 35 | return TagOffsetRecord.RECORD_SIZE; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/table/opentype/component/VisibleSubTable.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.sfntly.table.opentype.component; 2 | 3 | import com.google.typography.font.sfntly.data.ReadableFontData; 4 | import com.google.typography.font.sfntly.data.WritableFontData; 5 | import com.google.typography.font.sfntly.table.SubTable; 6 | 7 | public abstract class VisibleSubTable extends SubTable { 8 | private VisibleSubTable(ReadableFontData data) { 9 | super(data); 10 | } 11 | 12 | public abstract static class Builder extends SubTable.Builder { 13 | protected int serializedLength; 14 | 15 | protected Builder() { 16 | super(null); 17 | } 18 | 19 | protected Builder(ReadableFontData data) { 20 | super(data); 21 | } 22 | 23 | @Override 24 | public abstract int subSerialize(WritableFontData newData); 25 | 26 | /** 27 | * Even though public, not to be used by the end users. Made public only make it available to 28 | * packages under {@code com.google.typography.font.sfntly.table.opentype}. 29 | */ 30 | @Override 31 | public abstract int subDataSizeToSerialize(); 32 | 33 | @Override 34 | protected abstract void subDataSet(); 35 | 36 | @Override 37 | protected abstract T subBuildTable(ReadableFontData data); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/table/opentype/contextsubst/SubClassRule.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.sfntly.table.opentype.contextsubst; 2 | 3 | import com.google.typography.font.sfntly.data.ReadableFontData; 4 | import com.google.typography.font.sfntly.table.opentype.component.GlyphClassList; 5 | 6 | public class SubClassRule extends DoubleRecordTable { 7 | SubClassRule(ReadableFontData data, int base, boolean dataIsCanonical) { 8 | super(data, base, dataIsCanonical); 9 | } 10 | 11 | public GlyphClassList inputClasses() { 12 | return new GlyphClassList(inputGlyphs); 13 | } 14 | 15 | static class Builder extends DoubleRecordTable.Builder { 16 | Builder() { 17 | super(); 18 | } 19 | 20 | Builder(SubClassRule table) { 21 | super(table); 22 | } 23 | 24 | Builder(ReadableFontData data, int base, boolean dataIsCanonical) { 25 | super(data, base, dataIsCanonical); 26 | } 27 | 28 | @Override 29 | protected SubClassRule subBuildTable(ReadableFontData data) { 30 | return new SubClassRule(data, 0, true); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/table/opentype/contextsubst/SubGenericRuleSet.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.sfntly.table.opentype.contextsubst; 2 | 3 | import com.google.typography.font.sfntly.data.ReadableFontData; 4 | import com.google.typography.font.sfntly.table.opentype.component.OffsetRecordTable; 5 | 6 | public abstract class SubGenericRuleSet extends OffsetRecordTable { 7 | protected SubGenericRuleSet(ReadableFontData data, int base, boolean dataIsCanonical) { 8 | super(data, base, dataIsCanonical); 9 | } 10 | 11 | @Override 12 | public int fieldCount() { 13 | return 0; 14 | } 15 | 16 | protected abstract static class Builder< 17 | T extends SubGenericRuleSet, S extends DoubleRecordTable> 18 | extends OffsetRecordTable.Builder { 19 | 20 | protected Builder(ReadableFontData data, boolean dataIsCanonical) { 21 | super(data, dataIsCanonical); 22 | } 23 | 24 | protected Builder() { 25 | super(); 26 | } 27 | 28 | protected Builder(T table) { 29 | super(table); 30 | } 31 | 32 | @Override 33 | protected void initFields() {} 34 | 35 | @Override 36 | protected int fieldCount() { 37 | return 0; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/table/opentype/contextsubst/SubRule.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.sfntly.table.opentype.contextsubst; 2 | 3 | import com.google.typography.font.sfntly.data.ReadableFontData; 4 | 5 | public class SubRule extends DoubleRecordTable { 6 | SubRule(ReadableFontData data, int base, boolean dataIsCanonical) { 7 | super(data, base, dataIsCanonical); 8 | } 9 | 10 | static class Builder extends DoubleRecordTable.Builder { 11 | Builder() { 12 | super(); 13 | } 14 | 15 | Builder(SubRule table) { 16 | super(table); 17 | } 18 | 19 | Builder(ReadableFontData data, int base, boolean dataIsCanonical) { 20 | super(data, base, dataIsCanonical); 21 | } 22 | 23 | @Override 24 | protected SubRule subBuildTable(ReadableFontData data) { 25 | return new SubRule(data, 0, true); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/table/opentype/contextsubst/SubRuleSet.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.sfntly.table.opentype.contextsubst; 2 | 3 | import com.google.typography.font.sfntly.data.ReadableFontData; 4 | import com.google.typography.font.sfntly.table.opentype.component.VisibleSubTable; 5 | 6 | public class SubRuleSet extends SubGenericRuleSet { 7 | SubRuleSet(ReadableFontData data, int base, boolean dataIsCanonical) { 8 | super(data, base, dataIsCanonical); 9 | } 10 | 11 | @Override 12 | protected SubRule readSubTable(ReadableFontData data, boolean dataIsCanonical) { 13 | return new SubRule(data, base, dataIsCanonical); 14 | } 15 | 16 | static class Builder extends SubGenericRuleSet.Builder { 17 | Builder() { 18 | super(); 19 | } 20 | 21 | Builder(SubRuleSet table) { 22 | super(table); 23 | } 24 | 25 | Builder(ReadableFontData data, boolean dataIsCanonical) { 26 | super(data, dataIsCanonical); 27 | } 28 | 29 | @Override 30 | protected SubRuleSet readTable(ReadableFontData data, int base, boolean dataIsCanonical) { 31 | return new SubRuleSet(data, base, dataIsCanonical); 32 | } 33 | 34 | @Override 35 | protected VisibleSubTable.Builder createSubTableBuilder() { 36 | return new SubRule.Builder(); 37 | } 38 | 39 | @Override 40 | protected VisibleSubTable.Builder createSubTableBuilder( 41 | ReadableFontData data, boolean dataIsCanonical) { 42 | return new SubRule.Builder(data, 0, dataIsCanonical); 43 | } 44 | 45 | @Override 46 | protected VisibleSubTable.Builder createSubTableBuilder(SubRule subTable) { 47 | return new SubRule.Builder(subTable); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/table/opentype/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This package and its sub-packages contain, classes required to do: 3 | * 4 | *
    5 | *
  • Parse GSUB table 6 | *
  • Compute the closure of a given set of glyph IDs based on GSUB lookups 7 | *
8 | * 9 | * This is an experimental package. Please treat this API under this package as an alpha code. 10 | * 11 | * @author Cibu Johny 12 | */ 13 | package com.google.typography.font.sfntly.table.opentype; 14 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/sfntly/table/opentype/testing/TestLanguagesForFonts.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.sfntly.table.opentype.testing; 2 | 3 | import java.io.File; 4 | import java.io.IOException; 5 | import java.io.PrintWriter; 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | import java.util.Set; 9 | 10 | public class TestLanguagesForFonts { 11 | private static final String FONTS_ROOT = "/usr/local/google/home/cibu/sfntly/fonts"; 12 | private static final String WORDS_DIR = 13 | "/usr/local/google/home/cibu/sfntly/adv_layout/data/testdata/wiki_words"; 14 | private static final String OUTPUT_FILE = "/tmp/font-languages.txt"; 15 | 16 | private static final FontLanguages fontLanguages = new FontLanguages(availableLangs(WORDS_DIR)); 17 | 18 | public static void main(String[] args) throws IOException { 19 | List fontFiles = FontLoader.getFontFiles(FONTS_ROOT); 20 | PrintWriter writer = new PrintWriter(OUTPUT_FILE); 21 | for (File fontFile : fontFiles) { 22 | writer.print(fontFile.getPath()); 23 | Set langs = fontLanguages.get(FontLoader.getFont(fontFile)); 24 | if (langs.isEmpty()) { 25 | langs.add("en"); 26 | } 27 | for (String lang : langs) { 28 | writer.print("," + lang); 29 | } 30 | writer.println(); 31 | } 32 | writer.close(); 33 | } 34 | 35 | private static List availableLangs(String wordsDir) { 36 | List langs = new ArrayList<>(); 37 | File[] wordFiles = new File(wordsDir).listFiles(); 38 | for (File file : wordFiles) { 39 | String lang = file.getName(); 40 | if (lang.startsWith(".")) { 41 | continue; 42 | } 43 | langs.add(lang); 44 | } 45 | return langs; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/tools/conversion/build.properties: -------------------------------------------------------------------------------- 1 | src.dir=../../../../../../../src 2 | lib.dir=../../../../../../../lib 3 | build.dir=../../../../../../../build 4 | classes.dir=../../../../../../../build/classes 5 | dist_lib.dir=../../../../../../../dist/lib 6 | dist_eotconverter.dir=../../../../../../../dist/tools/conversion/eot 7 | dist_woffconverter.dir=../../../../../../../dist/tools/conversion/woff 8 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/tools/conversion/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 23 | 24 | 25 | 26 | 27 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/tools/fontinfo/build.properties: -------------------------------------------------------------------------------- 1 | src.dir=../../../../../../../src 2 | lib.dir=../../../../../../../lib 3 | build.dir=../../../../../../../build 4 | classes.dir=../../../../../../../build/classes 5 | dist_lib.dir=../../../../../../../dist/lib 6 | dist_fontinfo.dir=../../../../../../../dist/tools/fontinfo 7 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/tools/fontinfo/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/tools/fontviewer/AbstractNode.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.tools.fontviewer; 2 | 3 | import javax.swing.JComponent; 4 | import javax.swing.JScrollPane; 5 | import javax.swing.tree.DefaultMutableTreeNode; 6 | 7 | /** 8 | * The tree in the left panel is built from these nodes. Most of these nodes correspond to a "table" 9 | * of the font. 10 | * 11 | * @see FontNode 12 | */ 13 | abstract class AbstractNode extends DefaultMutableTreeNode { 14 | 15 | @Override 16 | public final String toString() { 17 | return getNodeName(); 18 | } 19 | 20 | protected abstract String getNodeName(); 21 | 22 | abstract JComponent render(); 23 | 24 | /** 25 | * Whether the component from {@link #render()} is wrapped in a {@link JScrollPane} so that it can 26 | * be arbitrarily large. Otherwise it can easily be truncated on small screens. 27 | */ 28 | boolean renderInScrollPane() { 29 | return true; 30 | } 31 | 32 | @Override 33 | public AbstractNode getChildAt(int index) { 34 | throw new UnsupportedOperationException(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/tools/fontviewer/CMapFormat4Node.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.tools.fontviewer; 2 | 3 | import com.google.typography.font.sfntly.table.core.CMapFormat4; 4 | import javax.swing.JComponent; 5 | import javax.swing.JTextArea; 6 | 7 | class CMapFormat4Node extends AbstractNode { 8 | 9 | private final CMapFormat4 cmap; 10 | 11 | CMapFormat4Node(CMapFormat4 cmap) { 12 | this.cmap = cmap; 13 | } 14 | 15 | @Override 16 | public int getChildCount() { 17 | return cmap.getSegCount(); 18 | } 19 | 20 | @Override 21 | public AbstractNode getChildAt(int index) { 22 | return new CmapSegmentNode(cmap, index); 23 | } 24 | 25 | @Override 26 | public String getNodeName() { 27 | return cmap.toString(); 28 | } 29 | 30 | @Override 31 | public JComponent render() { 32 | StringBuilder sb = new StringBuilder(); 33 | sb.append(String.format("Number of segments: %d%n", cmap.getSegCount())); 34 | for (int i = 0, imax = cmap.getSegCount(); i < imax; i++) { 35 | sb.append( 36 | String.format("%3d: from U+%04X until U+%04X%n", i, cmap.startCode(i), cmap.endCode(i))); 37 | } 38 | 39 | return new JTextArea(sb.toString()); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/tools/fontviewer/CmapSegmentNode.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.tools.fontviewer; 2 | 3 | import com.google.typography.font.sfntly.table.core.CMapFormat4; 4 | import javax.swing.JComponent; 5 | import javax.swing.JTextArea; 6 | 7 | class CmapSegmentNode extends AbstractNode { 8 | 9 | private final CMapFormat4 cmap; 10 | private final int index; 11 | 12 | CmapSegmentNode(CMapFormat4 cmap, int index) { 13 | this.cmap = cmap; 14 | this.index = index; 15 | } 16 | 17 | @Override 18 | public String getNodeName() { 19 | return String.format("U+%04X to U+%04X", cmap.startCode(index), cmap.endCode(index)); 20 | } 21 | 22 | @Override 23 | public JComponent render() { 24 | int start = cmap.startCode(index); 25 | int end = cmap.endCode(index); 26 | 27 | StringBuilder sb = new StringBuilder(); 28 | for (int cp = start; cp <= end; cp++) { 29 | sb.append(String.format("U+%04X -> %d%n", cp, cmap.glyphId(cp))); 30 | } 31 | return new JTextArea(sb.toString()); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/tools/fontviewer/ColumnTableModel.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.tools.fontviewer; 2 | 3 | import javax.swing.table.AbstractTableModel; 4 | 5 | abstract class ColumnTableModel extends AbstractTableModel { 6 | 7 | private final String[] columnNames; 8 | 9 | ColumnTableModel(String... columnNames) { 10 | assert columnNames.length > 0; 11 | this.columnNames = columnNames; 12 | } 13 | 14 | @Override 15 | public int getColumnCount() { 16 | return columnNames.length; 17 | } 18 | 19 | @Override 20 | public String getColumnName(int column) { 21 | return columnNames[column]; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/tools/fontviewer/GsubRuleNode.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.tools.fontviewer; 2 | 3 | import com.google.typography.font.sfntly.table.opentype.component.Rule; 4 | import javax.swing.JComponent; 5 | import javax.swing.JTextArea; 6 | 7 | public class GsubRuleNode extends AbstractNode { 8 | private final int index; 9 | private final Rule rule; 10 | 11 | public GsubRuleNode(int index, Rule rule) { 12 | this.index = index; 13 | this.rule = rule; 14 | } 15 | 16 | @Override 17 | protected String getNodeName() { 18 | return Integer.toString(index); 19 | } 20 | 21 | @Override 22 | JComponent render() { 23 | return new JTextArea(rule.toString()); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/tools/fontviewer/GsubRuleSetNode.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.tools.fontviewer; 2 | 3 | import com.google.typography.font.sfntly.table.opentype.component.Rule; 4 | import java.util.ArrayList; 5 | import java.util.List; 6 | import java.util.Set; 7 | import javax.swing.JComponent; 8 | import javax.swing.JTable; 9 | 10 | public class GsubRuleSetNode extends AbstractNode { 11 | private final int ruleSetId; 12 | private final List rules; 13 | 14 | public GsubRuleSetNode(int ruleSetId, Set rules) { 15 | this.ruleSetId = ruleSetId; 16 | this.rules = new ArrayList<>(rules); 17 | } 18 | 19 | @Override 20 | protected String getNodeName() { 21 | return Integer.toString(ruleSetId); 22 | } 23 | 24 | @Override 25 | public int getChildCount() { 26 | return rules.size(); 27 | } 28 | 29 | @Override 30 | public AbstractNode getChildAt(int index) { 31 | return new GsubRuleNode(index, rules.get(index)); 32 | } 33 | 34 | @Override 35 | JComponent render() { 36 | return new JTable(new Model()); 37 | } 38 | 39 | private class Model extends ColumnTableModel { 40 | 41 | Model() { 42 | super("Index", "Rule"); 43 | } 44 | 45 | @Override 46 | public int getRowCount() { 47 | return rules.size(); 48 | } 49 | 50 | @Override 51 | public Object getValueAt(int rowIndex, int columnIndex) { 52 | switch (columnIndex) { 53 | case 0: 54 | return Integer.toString(rowIndex); 55 | case 1: 56 | return rules.get(rowIndex); 57 | } 58 | throw new IllegalStateException(); 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/tools/fontviewer/GsubTableNode.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.tools.fontviewer; 2 | 3 | import com.google.typography.font.sfntly.table.opentype.GSubTable; 4 | import java.util.ArrayList; 5 | import java.util.List; 6 | import javax.swing.JComponent; 7 | import javax.swing.JTextArea; 8 | 9 | public class GsubTableNode extends AbstractNode { 10 | 11 | private final GSubTable gsub; 12 | private final List children = new ArrayList<>(); 13 | 14 | public GsubTableNode(GSubTable gsub) { 15 | this.gsub = gsub; 16 | children.add(new ScriptListTableNode(gsub.scriptList())); 17 | children.add(new SubTableNode(gsub.featureList(), "feature")); 18 | children.add(new SubTableNode(gsub.lookupList(), "lookup")); 19 | children.add(new GsubRuleSetsNode(gsub)); 20 | } 21 | 22 | @Override 23 | protected String getNodeName() { 24 | return "GSUB"; 25 | } 26 | 27 | @Override 28 | public int getChildCount() { 29 | return children.size(); 30 | } 31 | 32 | @Override 33 | public AbstractNode getChildAt(int index) { 34 | return children.get(index); 35 | } 36 | 37 | @Override 38 | JComponent render() { 39 | return new JTextArea(gsub.toString()); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/tools/fontviewer/JTableUtils.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.tools.fontviewer; 2 | 3 | import javax.swing.JTable; 4 | import javax.swing.SwingConstants; 5 | import javax.swing.table.DefaultTableCellRenderer; 6 | 7 | public enum JTableUtils { 8 | ; 9 | 10 | static void setNumberColumn(JTable table, int column) { 11 | DefaultTableCellRenderer rightAligned = new DefaultTableCellRenderer(); 12 | rightAligned.setHorizontalAlignment(SwingConstants.RIGHT); 13 | 14 | table.getColumnModel().getColumn(column).setMinWidth(70); 15 | table.getColumnModel().getColumn(column).setMaxWidth(70); 16 | table.getColumnModel().getColumn(column).setResizable(false); 17 | table.getColumnModel().getColumn(column).setCellRenderer(rightAligned); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/tools/fontviewer/LocaTableNode.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.tools.fontviewer; 2 | 3 | import com.google.typography.font.sfntly.table.truetype.LocaTable; 4 | import javax.swing.JComponent; 5 | import javax.swing.JTable; 6 | 7 | class LocaTableNode extends AbstractNode { 8 | 9 | private final LocaTable loca; 10 | 11 | LocaTableNode(LocaTable loca, String name) { 12 | setUserObject(name); 13 | this.loca = loca; 14 | } 15 | 16 | @Override 17 | protected String getNodeName() { 18 | return (String) getUserObject(); 19 | } 20 | 21 | @Override 22 | public JComponent render() { 23 | JTable table = new JTable(new Model()); 24 | JTableUtils.setNumberColumn(table, 0); 25 | JTableUtils.setNumberColumn(table, 1); 26 | JTableUtils.setNumberColumn(table, 2); 27 | return table; 28 | } 29 | 30 | private class Model extends ColumnTableModel { 31 | 32 | Model() { 33 | super("ID", "Glyph offset", "Glyph length"); 34 | } 35 | 36 | @Override 37 | public int getRowCount() { 38 | return loca.numGlyphs(); 39 | } 40 | 41 | @Override 42 | public Object getValueAt(int rowIndex, int columnIndex) { 43 | switch (columnIndex) { 44 | case 0: 45 | return rowIndex; 46 | case 1: 47 | return loca.glyphOffset(rowIndex); 48 | case 2: 49 | return loca.glyphLength(rowIndex); 50 | default: 51 | throw new IllegalStateException(); 52 | } 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/tools/fontviewer/ScriptListTableNode.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.tools.fontviewer; 2 | 3 | import com.google.typography.font.sfntly.table.opentype.ScriptListTable; 4 | import com.google.typography.font.sfntly.table.opentype.ScriptTable; 5 | import com.google.typography.font.sfntly.table.opentype.ScriptTag; 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | import java.util.Map; 9 | import java.util.TreeMap; 10 | import javax.swing.JComponent; 11 | import javax.swing.JTable; 12 | 13 | public class ScriptListTableNode extends AbstractNode { 14 | 15 | private final List> children; 16 | 17 | public ScriptListTableNode(ScriptListTable table) { 18 | this.children = new ArrayList<>(new TreeMap<>(table.map()).entrySet()); 19 | } 20 | 21 | @Override 22 | protected String getNodeName() { 23 | return "Scripts"; 24 | } 25 | 26 | @Override 27 | JComponent render() { 28 | return new JTable(new Model()); 29 | } 30 | 31 | private class Model extends ColumnTableModel { 32 | 33 | Model() { 34 | super("Key", "Value"); 35 | } 36 | 37 | @Override 38 | public int getRowCount() { 39 | return children.size(); 40 | } 41 | 42 | @Override 43 | public Object getValueAt(int rowIndex, int columnIndex) { 44 | switch (columnIndex) { 45 | case 0: 46 | return children.get(rowIndex).getKey(); 47 | case 1: 48 | return children.get(rowIndex).getValue(); 49 | default: 50 | throw new IllegalStateException(); 51 | } 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/tools/fontviewer/SubTableNode.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.tools.fontviewer; 2 | 3 | import com.google.typography.font.sfntly.table.FontDataTable; 4 | import com.google.typography.font.sfntly.table.core.CMap; 5 | import com.google.typography.font.sfntly.table.core.CMapFormat4; 6 | import com.google.typography.font.sfntly.table.core.CMapTable; 7 | import javax.swing.JComponent; 8 | import javax.swing.JTextArea; 9 | 10 | class SubTableNode extends AbstractNode { 11 | 12 | private static final long serialVersionUID = 1L; 13 | 14 | private final FontDataTable table; 15 | 16 | SubTableNode(FontDataTable table, String name) { 17 | setUserObject(name); 18 | this.table = table; 19 | } 20 | 21 | @Override 22 | public String getNodeName() { 23 | return (String) getUserObject(); 24 | } 25 | 26 | FontDataTable getTable() { 27 | return table; 28 | } 29 | 30 | @Override 31 | public int getChildCount() { 32 | if (table instanceof CMapTable) { 33 | return ((CMapTable) table).numCMaps(); 34 | } 35 | return 0; 36 | } 37 | 38 | @Override 39 | public AbstractNode getChildAt(int index) { 40 | if (table instanceof CMapTable) { 41 | CMap child = ((CMapTable) table).cmap(index); 42 | if (child.format() == 4) { 43 | return new CMapFormat4Node((CMapFormat4) child); 44 | } 45 | return new SubTableNode(child, child.toString()); 46 | } 47 | throw new IllegalStateException(); 48 | } 49 | 50 | @Override 51 | JComponent render() { 52 | return new JTextArea(table.readFontData().toString(4096)); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/tools/sfnttool/build.properties: -------------------------------------------------------------------------------- 1 | src.dir=../../../../../../../src 2 | lib.dir=../../../../../../../lib 3 | build.dir=../../../../../../../build 4 | classes.dir=../../../../../../../build/classes 5 | dist_lib.dir=../../../../../../../dist/lib 6 | dist_sfnttool.dir=../../../../../../../dist/tools/sfnttool 7 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/tools/sfnttool/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/tools/subsetter/DumbSubsetter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.typography.font.tools.subsetter; 18 | 19 | import com.google.typography.font.sfntly.Font; 20 | import com.google.typography.font.sfntly.FontFactory; 21 | import com.google.typography.font.sfntly.Tag; 22 | import java.util.HashSet; 23 | import java.util.Set; 24 | 25 | /** 26 | * Note: at the moment, this class just replicates the existing functionality in sfntly. It does 27 | * _not_ create a working font. 28 | * 29 | * @author Raph Levien 30 | */ 31 | public class DumbSubsetter extends Subsetter { 32 | 33 | { 34 | Set temp = new HashSet<>(); 35 | temp.add(new GlyphTableSubsetter()); 36 | temp.add(new CMapTableSubsetter()); 37 | tableSubsetters = temp; 38 | } 39 | 40 | public DumbSubsetter(Font font, FontFactory fontFactory) { 41 | super(font, fontFactory); 42 | } 43 | 44 | @Override 45 | protected void setUpTables(Font.Builder fontBuilder) { 46 | fontBuilder.newTableBuilder(Tag.maxp, font.getTable(Tag.maxp).readFontData()); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/tools/subsetter/HintStripper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.typography.font.tools.subsetter; 18 | 19 | import com.google.typography.font.sfntly.Font; 20 | import com.google.typography.font.sfntly.FontFactory; 21 | import java.util.HashSet; 22 | import java.util.Set; 23 | 24 | /** @author Raph Levien */ 25 | public class HintStripper extends Subsetter { 26 | 27 | { 28 | Set temp = new HashSet<>(); 29 | temp.add(new GlyphTableStripper()); 30 | tableSubsetters = temp; 31 | } 32 | 33 | public HintStripper(Font font, FontFactory fontFactory) { 34 | super(font, fontFactory); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/tools/subsetter/TableSubsetter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.typography.font.tools.subsetter; 18 | 19 | import com.google.typography.font.sfntly.Font; 20 | import java.io.IOException; 21 | import java.util.Set; 22 | 23 | /** @author Stuart Gill */ 24 | public interface TableSubsetter { 25 | 26 | public Set tagsHandled(); 27 | 28 | public boolean tagHandled(int tag); 29 | 30 | public boolean subset(Subsetter subsetter, Font font, Font.Builder fontBuilder) 31 | throws IOException; 32 | } 33 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/tools/subsetter/TableSubsetterImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.typography.font.tools.subsetter; 18 | 19 | import java.util.Collections; 20 | import java.util.HashSet; 21 | import java.util.Set; 22 | 23 | /** @author Stuart Gill */ 24 | public abstract class TableSubsetterImpl implements TableSubsetter { 25 | 26 | protected final Set tags; 27 | 28 | protected TableSubsetterImpl(Integer... tags) { 29 | Set temp = new HashSet<>(tags.length); 30 | Collections.addAll(temp, tags); 31 | this.tags = Collections.unmodifiableSet(temp); 32 | } 33 | 34 | @Override 35 | public boolean tagHandled(int tag) { 36 | return tags.contains(tag); 37 | } 38 | 39 | @Override 40 | public Set tagsHandled() { 41 | return tags; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/tools/subsetter/build.properties: -------------------------------------------------------------------------------- 1 | src.dir=../../../../../../../src 2 | lib.dir=../../../../../../../lib 3 | build.dir=../../../../../../../build 4 | classes.dir=../../../../../../../build/classes 5 | dist_lib.dir=../../../../../../../dist/lib 6 | dist_subsetter.dir=../../../../../../../dist/tools/subsetter 7 | -------------------------------------------------------------------------------- /java/src/com/google/typography/font/tools/subsetter/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /java/test/com/google/typography/font/sfntly/GPosTests.java: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Google Inc. All Rights Reserved. 2 | 3 | package com.google.typography.font.sfntly; 4 | 5 | import com.google.typography.font.sfntly.table.Header; 6 | import com.google.typography.font.sfntly.table.Table; 7 | import com.google.typography.font.sfntly.testutils.TestFont; 8 | import com.google.typography.font.sfntly.testutils.TestFontUtils; 9 | import java.io.IOException; 10 | import java.util.ArrayList; 11 | import java.util.List; 12 | import junit.framework.TestCase; 13 | 14 | /** @author dougfelt@google.com (Doug Felt) */ 15 | public class GPosTests extends TestCase { 16 | public void testGposFiles() { 17 | List gposFontList = new ArrayList<>(); 18 | for (TestFont.TestFontNames name : TestFont.TestFontNames.values()) { 19 | Font[] fonts; 20 | try { 21 | fonts = TestFontUtils.loadFont(name.getFile()); 22 | assertNotNull(fonts); 23 | } catch (IOException e) { 24 | System.out.format("caught exception (%s) when loading font %s\n", e.getMessage(), name); 25 | continue; 26 | } 27 | for (int i = 0; i < fonts.length; ++i) { 28 | Font font = fonts[i]; 29 | if (font.hasTable(Tag.GPOS)) { 30 | System.out.format("Font %s(%d) has GPOS\n", name, i); 31 | gposFontList.add(font); 32 | 33 | Table gpos = font.getTable(Tag.GPOS); 34 | Header gposHeader = gpos.header(); 35 | System.out.println(gposHeader); 36 | } 37 | } 38 | } 39 | assertTrue("have test gpos file", gposFontList.size() > 0); 40 | 41 | for (Font font : gposFontList) {} 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /java/test/com/google/typography/font/sfntly/MetricsTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.typography.font.sfntly; 18 | 19 | import com.google.typography.font.sfntly.table.core.HorizontalMetricsTable; 20 | import com.google.typography.font.sfntly.testutils.TestFont; 21 | import com.google.typography.font.sfntly.testutils.TestFontUtils; 22 | import java.io.File; 23 | import junit.framework.TestCase; 24 | 25 | /** @author Stuart Gill */ 26 | public class MetricsTests extends TestCase { 27 | 28 | private static final File TEST_FONT_FILE = TestFont.TestFontNames.OPENSANS.getFile(); 29 | 30 | public void testBasicHmtxValidity() throws Exception { 31 | Font[] fonts = TestFontUtils.loadFont(TEST_FONT_FILE); 32 | Font font = fonts[0]; 33 | HorizontalMetricsTable hmtxTable = font.getTable(Tag.hmtx); 34 | 35 | for (int gid = 0; gid < 100; gid++) { 36 | int width = hmtxTable.advanceWidth(gid); 37 | assertFalse(width == -1); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /java/test/com/google/typography/font/sfntly/data/SfStringUtilsTest.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.sfntly.data; 2 | 3 | import java.util.Arrays; 4 | import java.util.HashSet; 5 | import junit.framework.TestCase; 6 | 7 | public class SfStringUtilsTest extends TestCase { 8 | 9 | public void testGetAllCodepoints() { 10 | assertEquals( 11 | new HashSet<>(Arrays.asList(72, 101, 108, 111)), SfStringUtils.getAllCodepoints("Hello")); 12 | 13 | assertEquals( 14 | new HashSet<>(Arrays.asList(0x1F645)), 15 | SfStringUtils.getAllCodepoints(new String(new int[] {0x1F645}, 0, 1))); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /java/test/com/google/typography/font/sfntly/issue_tests/Issue27Tests.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.sfntly.issue_tests; 2 | 3 | import com.google.typography.font.sfntly.Font; 4 | import com.google.typography.font.sfntly.FontFactory; 5 | import com.google.typography.font.sfntly.Tag; 6 | import com.google.typography.font.sfntly.table.core.NameTable; 7 | import com.google.typography.font.sfntly.testutils.TestFont; 8 | import java.io.File; 9 | import java.io.FileInputStream; 10 | import junit.framework.TestCase; 11 | 12 | /* 13 | * Test for Issue 27. 14 | *

15 | * Adding a zero length name that sorts at the end of the name table. 16 | */ 17 | public class Issue27Tests extends TestCase { 18 | 19 | private static final File fontFile = TestFont.TestFontNames.OPENSANS.getFile(); 20 | 21 | public void testIssue27() throws Exception { 22 | FontFactory fontFactory = FontFactory.getInstance(); 23 | Font.Builder fontBuilder = fontFactory.loadFontsForBuilding(new FileInputStream(fontFile))[0]; 24 | NameTable.Builder nameTableBuilder = (NameTable.Builder) fontBuilder.getTableBuilder(Tag.name); 25 | // add a name that will sort after all the other names in the table 26 | nameTableBuilder 27 | .nameBuilder( 28 | Font.PlatformId.Windows.value(), 29 | Font.WindowsEncodingId.UnicodeUCS4.value(), 30 | NameTable.WindowsLanguageId.Spanish_UnitedStates.value(), 31 | NameTable.NameId.WWSSubfamilyName.value()) 32 | .setName(""); 33 | Font font = fontBuilder.build(); 34 | assertNotNull(font); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /java/test/com/google/typography/font/sfntly/math/FontMathTest.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.sfntly.math; 2 | 3 | import junit.framework.TestCase; 4 | 5 | public class FontMathTest extends TestCase { 6 | 7 | public void testLog2() { 8 | assertEquals(-1, FontMath.log2(0)); 9 | assertEquals(0, FontMath.log2(1)); 10 | assertEquals(1, FontMath.log2(2)); 11 | assertEquals(1, FontMath.log2(3)); 12 | assertEquals(2, FontMath.log2(4)); 13 | assertEquals(4, FontMath.log2(31)); 14 | assertEquals(5, FontMath.log2(32)); 15 | assertEquals(31, FontMath.log2(-1)); 16 | } 17 | 18 | public void testPaddingRequired() { 19 | assertEquals(0, FontMath.paddingRequired(4, 4)); 20 | assertEquals(3, FontMath.paddingRequired(5, 4)); 21 | assertEquals(1, FontMath.paddingRequired(7, 4)); 22 | assertEquals(0, FontMath.paddingRequired(8, 4)); 23 | assertEquals(0, FontMath.paddingRequired(17, 1)); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /java/test/com/google/typography/font/sfntly/table/bitmap/IndexSubTableTest.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.sfntly.table.bitmap; 2 | 3 | import com.google.typography.font.sfntly.data.ReadableFontData; 4 | import junit.framework.TestCase; 5 | 6 | public class IndexSubTableTest extends TestCase { 7 | 8 | public void testCreateBuilder() { 9 | try { 10 | IndexSubTable.Builder.createBuilder(27); 11 | fail(); 12 | } catch (IllegalArgumentException e) { 13 | assertEquals("Invalid index subtable format 27", e.getMessage()); 14 | } 15 | } 16 | 17 | public void testToString() { 18 | ReadableFontData data = 19 | ReadableFontData.createReadableFontData( 20 | new byte[] { 21 | 0, 22 | 1, // indexFormat 23 | 0, 24 | 17, // imageFormat 25 | 0, 26 | 0, 27 | 0, 28 | 8 // imageDataOffset 29 | }); 30 | 31 | IndexSubTable table = 32 | new IndexSubTable(data, 'a', 'a') { 33 | @Override 34 | public int glyphStartOffset(int glyphId) { 35 | throw new UnsupportedOperationException(); 36 | } 37 | 38 | @Override 39 | public int glyphLength(int glyphId) { 40 | throw new UnsupportedOperationException(); 41 | } 42 | 43 | @Override 44 | public int numGlyphs() { 45 | throw new UnsupportedOperationException(); 46 | } 47 | }; 48 | 49 | String expected = 50 | String.format( 51 | "%s%n", "IndexSubTable: [0x61 : 0x61], format = 1, image format = 17, imageOff = 0x8"); 52 | assertEquals(expected, table.toString()); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /java/test/com/google/typography/font/sfntly/table/core/CMapCharIteratorsTest.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.sfntly.table.core; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Arrays; 5 | import java.util.Iterator; 6 | import java.util.List; 7 | import junit.framework.TestCase; 8 | 9 | public class CMapCharIteratorsTest extends TestCase { 10 | 11 | public void testCharRangeIterator() { 12 | CMap.CharacterRangeIterator it = new CMap.CharacterRangeIterator(5, 8); 13 | 14 | assertEquals(Arrays.asList(5, 6, 7), toList(it)); 15 | } 16 | 17 | public void testCharRangesIterator() { 18 | int[][] ranges = {{0, 5}, {8, 8}, {10, 11}, {0, 3}}; 19 | 20 | CMap.CharacterRangesIterator it = 21 | new CMap.CharacterRangesIterator(ranges.length) { 22 | @Override 23 | protected int getRangeStart(int rangeIndex) { 24 | return ranges[rangeIndex][0]; 25 | } 26 | 27 | @Override 28 | protected int getRangeEnd(int rangeIndex) { 29 | return ranges[rangeIndex][1]; 30 | } 31 | }; 32 | 33 | assertEquals(Arrays.asList(0, 1, 2, 3, 4, 10, 0, 1, 2), toList(it)); 34 | } 35 | 36 | private static List toList(Iterator it) { 37 | List list = new ArrayList<>(); 38 | while (it.hasNext()) { 39 | list.add(it.next()); 40 | } 41 | return list; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /java/test/com/google/typography/font/sfntly/table/opentype/LanguageTagTest.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.sfntly.table.opentype; 2 | 3 | import static org.hamcrest.CoreMatchers.is; 4 | import static org.junit.Assert.assertThat; 5 | 6 | import org.junit.Test; 7 | 8 | public class LanguageTagTest { 9 | 10 | @Test 11 | public void testDataConsistency() { 12 | for (LanguageTag languageTag : LanguageTag.values()) { 13 | assertThat(languageTag.languageSystem(), is(languageTag.languageSystem().trim())); 14 | 15 | for (String iso3 : languageTag.iso3List()) { 16 | assertThat(iso3.replaceAll("^[a-z]{3}$", ""), is("")); 17 | } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /java/test/com/google/typography/font/sfntly/testutils/SfAssert.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.sfntly.testutils; 2 | 3 | import com.google.typography.font.sfntly.table.Table; 4 | import java.io.ByteArrayOutputStream; 5 | import java.io.IOException; 6 | import org.junit.Assert; 7 | 8 | public final class SfAssert { 9 | 10 | public static void assertTableHexDumpEquals(String hex, Table table) { 11 | try { 12 | ByteArrayOutputStream baos = new ByteArrayOutputStream(); 13 | table.serialize(baos); 14 | byte[] bytes = baos.toByteArray(); 15 | 16 | Assert.assertEquals(hex, hexdump(bytes)); 17 | } catch (IOException e) { 18 | throw new IllegalStateException(e); 19 | } 20 | } 21 | 22 | private static String hexdump(byte[] bytes) { 23 | StringBuilder sb = new StringBuilder(); 24 | for (int i = 0; i < bytes.length; i++) { 25 | sb.append("0123456789abcdef".charAt((bytes[i] >> 4) & 0x0f)); 26 | sb.append("0123456789abcdef".charAt(bytes[i] & 0x0f)); 27 | if (i + 1 < bytes.length) { 28 | sb.append(i % 16 == 15 ? "\n" : " "); 29 | } 30 | } 31 | return sb.toString(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /java/test/com/google/typography/font/sfntly/testutils/TestFont.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.typography.font.sfntly.testutils; 18 | 19 | import java.io.File; 20 | 21 | /** 22 | * Holds TestFontNames enums which can be loaded into Fonts. Later, this will have support for 23 | * checking the fingerprints to make sure that the fonts haven't been changed. 24 | * 25 | * @author Vinay Shah 26 | */ 27 | public class TestFont { 28 | 29 | private static final String TESTDATA_PATH = "../data/testdata/"; 30 | 31 | public enum TestFontNames { 32 | DROIDSANS("DroidSans-Regular.ttf"), 33 | OPENSANS("OpenSans-Regular.ttf"), 34 | ROBOTO("Roboto-Regular.ttf"); 35 | 36 | private final String path; 37 | 38 | private TestFontNames(String path) { 39 | this.path = path; 40 | } 41 | 42 | public File getFile() { 43 | return new File(TESTDATA_PATH + path); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /java/test/com/google/typography/font/sfntly/testutils/TestUtilsTest.java: -------------------------------------------------------------------------------- 1 | package com.google.typography.font.sfntly.testutils; 2 | 3 | import org.assertj.core.api.Assertions; 4 | import org.junit.Test; 5 | 6 | public class TestUtilsTest { 7 | 8 | @Test 9 | public void hexFrom() { 10 | Assertions.assertThat(TestUtils.fromHex("").size()).isEqualTo(0); 11 | 12 | Assertions.assertThat(TestUtils.fromHex("12 34 56 78").size()).isEqualTo(4); 13 | 14 | Assertions.assertThat(TestUtils.fromHex("12 34 56 78").readULong(0)).isEqualTo(0x12345678); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /java/test/com/google/typography/font/tools/conversion/eot/HuffmanEncoderTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.typography.font.tools.conversion.eot; 18 | 19 | import junit.framework.TestCase; 20 | 21 | /** @author Raph Levien */ 22 | public class HuffmanEncoderTest extends TestCase { 23 | 24 | public void testBitsUsed() { 25 | assertEquals(1, HuffmanEncoder.bitsUsed(0)); 26 | assertEquals(1, HuffmanEncoder.bitsUsed(1)); 27 | assertEquals(8, HuffmanEncoder.bitsUsed(255)); 28 | assertEquals(9, HuffmanEncoder.bitsUsed(256)); 29 | assertEquals(32, HuffmanEncoder.bitsUsed(-1)); 30 | } 31 | 32 | public void testInitConsistency() { 33 | BitIOWriter bits = new BitIOWriter(); 34 | HuffmanEncoder h = new HuffmanEncoder(bits, 512); 35 | assertNull(h.checkTree()); 36 | } 37 | 38 | public void testRetainConsistency() { 39 | BitIOWriter bits = new BitIOWriter(); 40 | HuffmanEncoder h = new HuffmanEncoder(bits, 8); 41 | for (int i = 0; i < 1024; i++) { 42 | assertNull("Iteration " + i, h.checkTree()); 43 | h.writeSymbol((i & 1) != 0 ? 0 : i & 7); 44 | } 45 | } 46 | } 47 | --------------------------------------------------------------------------------