Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
86abe3cb
Kaydet (Commit)
86abe3cb
authored
Kas 01, 2016
tarafından
Khaled Hosny
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Revert "tdf#103403: Wrong glyph advances with Graphite"
This reverts commit
3d83c420
. A simpler fix in the next commit.
üst
d79f43d0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
131 deletions
+0
-131
0001-graphite-Fix-shaping-with-varying-font-size.patch
...zz/0001-graphite-Fix-shaping-with-varying-font-size.patch
+0
-130
UnpackedTarball_harfbuzz.mk
external/harfbuzz/UnpackedTarball_harfbuzz.mk
+0
-1
No files found.
external/harfbuzz/0001-graphite-Fix-shaping-with-varying-font-size.patch
deleted
100644 → 0
Dosyayı görüntüle @
d79f43d0
From 82f7be388090f19333876877366907fec09f0312 Mon Sep 17 00:00:00 2001
From: Khaled Hosny <khaledhosny@eglug.org>
Date: Sun, 30 Oct 2016 20:16:41 +0200
Subject: [PATCH] [graphite] Fix shaping with varying font size
See https://bugs.documentfoundation.org/show_bug.cgi?id=103403#c7
---
src/hb-graphite2.cc | 40 ++++++++++++++++++++++++++++------------
1 file changed, 28 insertions(+), 12 deletions(-)
diff --git a/src/hb-graphite2.cc b/src/hb-graphite2.cc
index c32318d..138a5ae 100644
--- src/hb-graphite2.cc
+++ src/hb-graphite2.cc
@@ -27,7 +27,6 @@
*/
#define HB_SHAPER graphite2
-#define hb_graphite2_shaper_font_data_t gr_font
#include "hb-shaper-impl-private.hh"
#include "hb-graphite2.h"
@@ -55,6 +54,12 @@ struct hb_graphite2_shaper_face_data_t {
hb_graphite2_tablelist_t *tlist;
};
+struct hb_graphite2_shaper_font_data_t {
+ gr_font *grfont;
+ int xscale;
+ int yscale;
+};
+
static const void *hb_graphite2_get_table (const void *data, unsigned int tag, size_t *len)
{
hb_graphite2_shaper_face_data_t *face_data = (hb_graphite2_shaper_face_data_t *) data;
@@ -166,13 +171,20 @@ _hb_graphite2_shaper_font_data_create (hb_font_t *font)
hb_face_t *face = font->face;
hb_graphite2_shaper_face_data_t *face_data = HB_SHAPER_DATA_GET (face);
- return gr_make_font_with_advance_fn (font->x_scale, font, &hb_graphite2_get_advance, face_data->grface);
+ hb_graphite2_shaper_font_data_t *data = (hb_graphite2_shaper_font_data_t *) calloc (1, sizeof (hb_graphite2_shaper_font_data_t));
+ data->grfont = gr_make_font_with_advance_fn (font->x_scale, font, &hb_graphite2_get_advance, face_data->grface);
+ data->xscale = font->x_scale;
+ data->yscale = font->y_scale;
+
+ return data;
}
void
_hb_graphite2_shaper_font_data_destroy (hb_graphite2_shaper_font_data_t *data)
{
- gr_font_destroy (data);
+ gr_font_destroy (data->grfont);
+
+ free (data);
}
/*
@@ -182,7 +194,7 @@ gr_font *
hb_graphite2_font_get_gr_font (hb_font_t *font)
{
if (unlikely (!hb_graphite2_shaper_font_data_ensure (font))) return NULL;
- return HB_SHAPER_DATA_GET (font);
+ return HB_SHAPER_DATA_GET (font)->grfont;
}
@@ -228,7 +240,7 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan,
{
hb_face_t *face = font->face;
gr_face *grface = HB_SHAPER_DATA_GET (face)->grface;
- gr_font *grfont = HB_SHAPER_DATA_GET (font);
+ gr_font *grfont = HB_SHAPER_DATA_GET (font)->grfont;
const char *lang = hb_language_to_string (hb_buffer_get_language (buffer));
const char *lang_end = lang ? strchr (lang, '-') : NULL;
@@ -371,7 +383,11 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan,
}
buffer->len = glyph_count;
- float yscale = font->y_scale / font->x_scale;
+ hb_graphite2_shaper_font_data_t* font_data = HB_SHAPER_DATA_GET (font);
+
+ float xscale = (float) font->x_scale / (float) font_data->xscale;
+ float yscale = (float) font->y_scale / (float) font_data->yscale;
+ yscale *= yscale / xscale;
/* Positioning. */
if (!HB_DIRECTION_IS_BACKWARD(buffer->props.direction))
{
@@ -381,10 +397,10 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan,
curradvx = 0;
for (is = gr_seg_first_slot (seg); is; pPos++, ++info, is = gr_slot_next_in_segment (is))
{
- pPos->x_offset = gr_slot_origin_X (is) - curradvx;
+ pPos->x_offset = gr_slot_origin_X (is) * xscale - curradvx;
pPos->y_offset = gr_slot_origin_Y (is) * yscale - curradvy;
if (info->cluster != currclus) {
- pPos->x_advance = info->var1.i32;
+ pPos->x_advance = info->var1.i32 * xscale;
curradvx += pPos->x_advance;
currclus = info->cluster;
} else
@@ -399,20 +415,20 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan,
int currclus = -1;
const hb_glyph_info_t *info = buffer->info;
hb_glyph_position_t *pPos = hb_buffer_get_glyph_positions (buffer, NULL);
- curradvx = gr_seg_advance_X(seg);
+ curradvx = gr_seg_advance_X(seg) * xscale;
for (is = gr_seg_first_slot (seg); is; pPos++, info++, is = gr_slot_next_in_segment (is))
{
if (info->cluster != currclus)
{
- pPos->x_advance = info->var1.i32;
- if (currclus != -1) curradvx -= info[-1].var1.i32;
+ pPos->x_advance = info->var1.i32 * xscale;
+ if (currclus != -1) curradvx -= info[-1].var1.i32 * xscale;
currclus = info->cluster;
} else
pPos->x_advance = 0.;
pPos->y_advance = gr_slot_advance_Y (is, grface, grfont) * yscale;
curradvy -= pPos->y_advance;
- pPos->x_offset = gr_slot_origin_X (is) - curradvx + pPos->x_advance;
+ pPos->x_offset = gr_slot_origin_X (is) * xscale - curradvx + pPos->x_advance;
pPos->y_offset = gr_slot_origin_Y (is) * yscale - curradvy;
}
hb_buffer_reverse_clusters (buffer);
--
2.10.1
external/harfbuzz/UnpackedTarball_harfbuzz.mk
Dosyayı görüntüle @
86abe3cb
...
@@ -16,7 +16,6 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,harfbuzz,0))
...
@@ -16,7 +16,6 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,harfbuzz,0))
$(eval $(call gb_UnpackedTarball_add_patches,harfbuzz, \
$(eval $(call gb_UnpackedTarball_add_patches,harfbuzz, \
external/harfbuzz/ubsan.patch \
external/harfbuzz/ubsan.patch \
external/harfbuzz/clang-cl.patch \
external/harfbuzz/clang-cl.patch \
external/harfbuzz/0001-graphite-Fix-shaping-with-varying-font-size.patch \
))
))
ifneq ($(ENABLE_RUNTIME_OPTIMIZATIONS),TRUE)
ifneq ($(ENABLE_RUNTIME_OPTIMIZATIONS),TRUE)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment