diff --git a/docs/usermanual-integration.xml b/docs/usermanual-integration.xml index b8a52c9f7..9fd94c85a 100644 --- a/docs/usermanual-integration.xml +++ b/docs/usermanual-integration.xml @@ -19,7 +19,7 @@ text-rendering pipeline, and will discuss the APIs available to integrate HarfBuzz with contemporary Linux, Mac, and Windows software. It will also show how HarfBuzz integrates with popular - external libaries like FreeType and International Components for + external libraries like FreeType and International Components for Unicode (ICU) and describe the HarfBuzz language bindings for Python. @@ -203,7 +203,7 @@ #include <hb-ft.h> ... - FT_New_Face(ft_library, font_path, index, &face); + FT_New_Face(ft_library, font_path, index, &face); FT_Set_Char_Size(face, 0, 1000, 0, 0); hb_font_t *font = hb_ft_font_create(face); @@ -303,16 +303,101 @@
Uniscribe integration - + If your client program is running on Windows, HarfBuzz can + integrate with the Uniscribe engine. - + Overall, the Uniscribe API covers a broader set of typographic + layout functions than HarfBuzz implements, but HarfBuzz's + shaping API can serve as a drop-in replacement for the shaping + functionality. In fact, one of HarfBuzz's design goals is to + accurately reproduce the same output for shaping a given text + segment that Uniscribe produces — even to the point of + duplicating known shaping bugs or deviations from the + specification — so you can be sure that your users' + documents with their existing fonts will not be affected by + switching to HarfBuzz. + At a basic level, HarfBuzz's hb_shape() + function replaces both the ScriptShape() + and ScriptPlace() functions from + Uniscribe. + + + However, whereas ScriptShape() returns the + glyphs and clusters for a shaped sequence and + ScriptPlace() returns the advances and + offsets for those glyphs, hb_shape() + handles both. After hb_shape() shapes a + buffer, the output glyph IDs and cluster IDs are returned as + an array of hb_glyph_info_t structures, and the + glyph advances and offsets are returned as an array of + hb_glyph_position_t structures. + + + Your client program only needs to ensure that it coverts + correctly between HarfBuzz's low-level data types (such as + hb_position_t) and Windows's corresponding types + (such as GOFFSET and ABC). Be sure you + read the + chapter for a full explanation of how HarfBuzz input buffers are + used, and see for the + details of what hb_shape() returns in the + output buffer when shaping is complete. + + + Although hb_shape() itself is functionally + equivalent to Uniscribe's shaping routines, there are two + additional HarfBuzz functions you may want to use to integrate + the libraries in your code. Both are used to link HarfBuzz font + objects to the equivalent Windows structures. + + + The hb_uniscribe_font_get_logfontw() + function takes a hb_font_t font object and returns + a pointer to the LOGFONTW + "logical font" that corresponds to it. A LOGFONTW + structure holds font-wide attributes, including metrics, size, + and style information. + +SCRIPT_CACHE holds context, including LOGFONT https://docs.microsoft.com/en-us/windows/desktop/Intl/script-cache + https://docs.microsoft.com/en-us/windows/desktop/api/wingdi/ns-wingdi-logfontw + + + The hb_uniscribe_font_get_hfont() function + also takes a hb_font_t font object, but it returns + an HFONT — a handle to the underlying logical + font — instead. + + + LOGFONTWs and HFONTs are both needed + by other Uniscribe functions. + + + As a final note, you may notice a reference to an optional + uniscribe shaper back-end in the section of the HarfBuzz manual. This + option is not a Uniscribe-integration facility. + + + Instead, it is a internal code path used in the + hb-shape command-line utility, which hands + shaping functionality over to Uniscribe entirely, when run on a + Windows system. That allows testing HarfBuzz's native output + against the Uniscribe engine, for tracking compatibility and + debugging. + + + Because this back-end is only used when testing HarfBuzz + functionality, it is disabled by default when building the + HarfBuzz binaries.
- +
CoreText integration @@ -323,6 +408,21 @@ + + + + + + + + + + + + + + +