<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    On 6/24/22 20:29, Behdad Esfahbod wrote:<br>
    <blockquote type="cite"
cite="mid:CAF63+7WJbTN+DppeyL8DaL=GjHnxJdeSiwOsjEBhrqU3kFghUA@mail.gmail.com">
      <pre class="moz-quote-pre" wrap="">Hi,

I've been looking at the internal Wine implementation of usp10.dll, and
wondering if there is an interest to integrate with HarfBuzz instead /
optionally.</pre>
    </blockquote>
    <br>
    Hi, Behdad.<br>
    <br>
    Uniscribe implementation hasn't been touched in a while. DirectWrite
    implementation currently supports all types of GSUB/GPOS lookups,
    uses structure and code taken from harfbuzz wrt to feature masks,
    loop organization, sorting, etc. Currently it only implements Arabic
    shaping.<br>
    <br>
    My longer term plan was to move all that to a separate
    textshaping.dll that modern Windows releases are using, and link to
    it from both gdi32 and dwrite, after removing existing uniscribe
    code. We don't need textshaping.dll interface to be compatible with
    Windows, because it's undocumented and isn't used by applications
    directly.<br>
    <blockquote type="cite"
cite="mid:CAF63+7WJbTN+DppeyL8DaL=GjHnxJdeSiwOsjEBhrqU3kFghUA@mail.gmail.com">
      <pre class="moz-quote-pre" wrap="">

The main hindrance is that HarfBuzz does NOT currently provide separate
substitution vs positioning steps ala ScriptShape() and ScriptPosition().
But I've been thinking about how to make that possibly happen, at least
enough for Wine's needs.</pre>
    </blockquote>
    <br>
    Yes, I believe we talked about that some time (few years?) ago.
    Uniscribe's ScriptShape() and dwrite's GetGlyphs() are using very
    similar interface, and we'll need DWRITE_SHAPING_TEXT_PROPERTIES and
    DWRITE_SHAPING_GLYPH_PROPERTIES to be compatible with what Windows
    returns.<br>
    <br>
    When I was working on this I found what some of the "reserved"
    fields mean in SHAPING_GLYPH_PROPERTIES, you can find structure
    definition in dlls/dwrite/<span style="color: rgb(23, 23, 23); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: pre; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(242, 242, 242); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"></span>dwrite_private.h:struct
    shaping_glyph_properties. I'm talking about last two fields
    "components" and "lig_component", that are important for GPOS
    handling.<br>
    <br>
    Another field that harfbuzz does not provide I think is
    "DWRITE_SHAPING_GLYPH_PROPERTIES.justification" mask, which I
    believe is only useful for Arabic shaping, and roughly corresponds
    to character classes.<br>
    <br>
    So technically, if we get correct ScriptShape()-style output from
    harfbuzz, including correct clustermap in WCHAR terms, we don't
    really need harfbuzz to produce ScriptPosition() output, because we
    have that implemented, and afaik it does not require script-specific
    handling, except maybe for features that have to be enabled.<br>
    <br>
    Another consideration is that we'll likely have to import harfbuzz
    code, and build it as a static win32 library. That's not a decision
    I can make. I think the only build requirement would be a recent
    enough C++ compiler? And maybe ragel, at some point you had
    precompiled header in the tree. We'll have to ask Alexandre's
    opinion here.<br>
    <br>
    We could also benefit from harfbuzz subsetter, and use it for
    fontsub and for Direct2D XPS printing.<br>
    <br>
    <blockquote type="cite"
cite="mid:CAF63+7WJbTN+DppeyL8DaL=GjHnxJdeSiwOsjEBhrqU3kFghUA@mail.gmail.com">
      <pre class="moz-quote-pre" wrap="">

Regards,

behdad
<a class="moz-txt-link-freetext" href="http://behdad.org/">http://behdad.org/</a>

</pre>
    </blockquote>
    <br>
  </body>
</html>