Commit 6e356742 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

dwrite: Improve strikethrough and underline thickness extraction logic.

parent 6d0fa4ce
......@@ -1243,17 +1243,10 @@ void opentype_get_font_metrics(struct file_stream_desc *stream_desc, DWRITE_FONT
metrics->underlineThickness = GET_BE_WORD(tt_post->underlineThickness);
}
/* use any of thickness values if another one is zero, if both are zero use estimate */
if (metrics->strikethroughThickness || metrics->underlineThickness) {
if (!metrics->strikethroughThickness)
metrics->strikethroughThickness = metrics->underlineThickness;
if (!metrics->underlineThickness)
metrics->underlineThickness = metrics->strikethroughThickness;
}
else {
metrics->strikethroughThickness = metrics->designUnitsPerEm / 14;
if (metrics->underlineThickness == 0)
metrics->underlineThickness = metrics->designUnitsPerEm / 14;
}
if (metrics->strikethroughThickness == 0)
metrics->strikethroughThickness = metrics->underlineThickness;
/* estimate missing metrics */
if (metrics->xHeight == 0)
......
......@@ -1725,16 +1725,10 @@ static void get_expected_font_metrics(IDWriteFontFace *fontface, DWRITE_FONT_MET
metrics->underlineThickness = GET_BE_WORD(tt_post->underlineThickness);
}
if (metrics->strikethroughThickness || metrics->underlineThickness) {
if (!metrics->strikethroughThickness)
metrics->strikethroughThickness = metrics->underlineThickness;
if (!metrics->underlineThickness)
metrics->underlineThickness = metrics->strikethroughThickness;
}
else {
metrics->strikethroughThickness = metrics->designUnitsPerEm / 14;
if (metrics->underlineThickness == 0)
metrics->underlineThickness = metrics->designUnitsPerEm / 14;
}
if (metrics->strikethroughThickness == 0)
metrics->strikethroughThickness = metrics->underlineThickness;
if (tt_os2)
IDWriteFontFace_ReleaseFontTable(fontface, os2_context);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment