dwrite: Support DWRITE_TRIMMING_GRANULARITY_WORD mode.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2017-09-11 12:37:14 +03:00 committed by Alexandre Julliard
parent 9058fc0acc
commit 096df5f5ba
1 changed files with 9 additions and 1 deletions

View File

@ -1879,7 +1879,15 @@ static void layout_add_line(struct dwrite_textlayout *layout, UINT32 first_clust
while (last_cluster > first_cluster) {
if (trimmed_width + sign_metrics.width <= layout->metrics.layoutWidth)
break;
trimmed_width -= layout->clustermetrics[last_cluster--].width;
if (layout->format.trimming.granularity == DWRITE_TRIMMING_GRANULARITY_CHARACTER)
trimmed_width -= layout->clustermetrics[last_cluster--].width;
else {
while (last_cluster > first_cluster) {
trimmed_width -= layout->clustermetrics[last_cluster].width;
if (layout->clustermetrics[last_cluster--].canWrapLineAfter)
break;
}
}
}
append_trimming_run = TRUE;
}