[WinCairo] Get cap-height font metrics for initial-letter supportw -webkit-initial-letter doesn't work for WinCairo. See also: Bug 136841 – Implement cap height in SimpleFontDataWin to enable initial-letter support for Windows Bug 137108 – [freetype] Fix support for the initial-letter CSS property to first-letter
DirectWrite has a API to get capHeight. https://learn.microsoft.com/en-us/windows/win32/api/dwrite/ns-dwrite-dwrite_font_metrics But, no such win32 API. I think (tmAscent - tmInternalLeading) is the capHeight. https://learn.microsoft.com/en-us/windows/win32/api/wingdi/ns-wingdi-textmetrica https://learn.microsoft.com/en-us/windows/win32/gdi/string-widths-and-heights
Created attachment 464168 [details] Patch
Comment on attachment 464168 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=464168&action=review Fix then land > Source/WebCore/platform/graphics/win/SimpleFontDataCairoWin.cpp:81 > + m_fontMetrics.setCapHeight(ascent); Shouldn’t this be capHeight?
Comment on attachment 464168 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=464168&action=review >> Source/WebCore/platform/graphics/win/SimpleFontDataCairoWin.cpp:81 >> + m_fontMetrics.setCapHeight(ascent); > > Shouldn’t this be capHeight? Good catch. Will fix. Thank you for the review.
Created attachment 464191 [details] [fast-cq] Patch
Committed 258319@main (998885749458): <https://commits.webkit.org/258319@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 464191 [details].
<rdar://problem/103684193>