> Cc: beh...@behdad.org, harfbuzz@lists.freedesktop.org > From: Jonathan Kew <jfkth...@gmail.com> > Date: Sat, 11 May 2019 22:15:46 +0100 > > > Would wrapping in a blob the buffer returned by GetFontData be enough? > > If you use GetFontData to get the complete font as a single buffer (i.e. > pass zero for the dwTable parameter), yes. > > Alternatively, you could use hb_face_create_for_tables, with a > reference_table_func that uses GetFontData to read individual tables > when harfbuzz asks for them.
FTR, I found that using GetFontData to produce a blob that wraps the entire data of a font does work, but is not really practical, except in small test programs. If you have a program that occasionally needs to load many fonts in order to display many different scripts at the same time (Emacs basically does that all the time), you will likely run out of memory, especially in 32-bit builds, because some fonts are simply huge (I've seen fonts of several dozen MBs). A 32-bit build of Emacs ran out of memory when displaying the HELLO file, which shows a greeting in many different scripts. So eventually, I went with the hb_face_create_for_tables method. _______________________________________________ HarfBuzz mailing list HarfBuzz@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/harfbuzz