<html>
    <head>
      <base href="https://bugs.webkit.org/">
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [FreeType] Add initial implementation of variation fonts"
   href="https://bugs.webkit.org/show_bug.cgi?id=192151#c12">Comment # 12</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [FreeType] Add initial implementation of variation fonts"
   href="https://bugs.webkit.org/show_bug.cgi?id=192151">bug 192151</a>
              from <span class="vcard"><a class="email" href="mailto:mmaxfield@apple.com" title="Myles C. Maxfield <mmaxfield@apple.com>"> <span class="fn">Myles C. Maxfield</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=356597&action=diff" name="attach_356597" title="Patch">attachment 356597</a> <a href="attachment.cgi?id=356597&action=edit" title="Patch">[details]</a></span>
Patch

View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=356597&action=review">https://bugs.webkit.org/attachment.cgi?id=356597&action=review</a>

<span class="quote">> Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp:46
> +#include FT_MULTIPLE_MASTERS_H</span >

Is this a header file? I'm confused.

<span class="quote">> Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp:523
> +String buildVariationSettings(FT_Face face, const FontDescription& fontDescription)
> +{
> +    auto defaultValues = defaultVariationValues(face);
> +    const auto& variations = fontDescription.variationSettings();
> +
> +    VariationsMap variationsToBeApplied;
> +    auto applyVariation = [&](const FontTag& tag, float value) {
> +        auto iterator = defaultValues.find(tag);
> +        if (iterator == defaultValues.end())
> +            return;
> +        float valueToApply = clampTo(value, iterator->value.minimumValue, iterator->value.maximumValue);
> +        variationsToBeApplied.set(tag, valueToApply);
> +    };
> +
> +    for (auto& variation : variations)
> +        applyVariation(variation.tag(), variation.value());
> +
> +    StringBuilder builder;
> +    for (auto& variation : variationsToBeApplied) {
> +        if (!builder.isEmpty())
> +            builder.append(',');
> +        builder.append(variation.key[0]);
> +        builder.append(variation.key[1]);
> +        builder.append(variation.key[2]);
> +        builder.append(variation.key[3]);
> +        builder.append('=');
> +        builder.appendNumber(variation.value);
> +    }
> +    return builder.toString();</span >

Can't we share this code? We could build up a HashMap and then the cocoa ports could re-encode it as a CFDictionary at the last minute.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>