Hi, hope this is the right place to ask. I maintain reportlab and although we have some code that attempts to make use of TrueType fonts I believe the subsetting is not very good.
I would like to make use of the subsetting capabilities of fontTools.
I tried some small example subsets and find that I seem to have more glyphs than are present in my requested unicodes. Our current code tries to implement subsetting on the fly by keeping a list of unicode points that have been used. When we reach a full subset say 255 codes we start a new subset. The cmap is exactly parallel to the subset.
Looking at my example via ttx for /usr/share/fonts/TTF/NotoSansMyanmar-Regular.ttf with unicodes 0x20 0x1000 0x103c 0x1031 0x1038 I find that glyph order shows 7 glyphs .notdef, space, ka, medial_ra, medial_ra.w2, _e & visarga. However, the cmap (in two variants) just shows my 5 desired code points. I'm confused about what ordinal I should use for my PDF text. Normally the input text translated via the subset ordering and can use bytes 0<=b<=255. Is the cmap the right ordering or is it the glyphOrder. Currently we make cmap the .notdef, but even though it seems to be added to the subset font it doesn't appear in the cmap.