Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/3519

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/19/3519/1

Determine if glyph is diacritic from GDEF table

GDEF table should have the definitive answer about glyph class,
including if it is a mark (diacritic[sic]) or not. Though I don't know
what GlyphItem::IS_DIACRITIC flag is used for, if at all.

Change-Id: Ib935dd571e2191eb5f8ae72650394293dd248140
---
M vcl/generic/glyphs/gcach_layout.cxx
1 file changed, 3 insertions(+), 2 deletions(-)



diff --git a/vcl/generic/glyphs/gcach_layout.cxx b/vcl/generic/glyphs/gcach_layout.cxx
index 02392c2..8fbe9d7 100644
--- a/vcl/generic/glyphs/gcach_layout.cxx
+++ b/vcl/generic/glyphs/gcach_layout.cxx
@@ -34,6 +34,7 @@
 #if ENABLE_HARFBUZZ
 #include <hb-ft.h>
 #include <hb-icu.h>
+#include <hb-ot.h>
 #else
 #include <layout/LayoutEngine.h>
 #include <layout/LEFontInstance.h>
@@ -166,6 +167,7 @@
         meScriptCode = eScriptCode;
 
         hb_font_t *aHbFont = hb_ft_font_create(aFace, NULL);
+        hb_face_t *aHbFace = hb_font_get_face(aHbFont);
 
         LanguageTag aLangTag(rArgs.meLanguage);
         OString sLanguage = OUStringToOString(aLangTag.getLanguage(), RTL_TEXTENCODING_UTF8);
@@ -220,8 +222,7 @@
             if (bInCluster)
                 nGlyphFlags |= GlyphItem::IS_IN_CLUSTER;
 
-            // XXX: query GDEF glyph class? Do we even need this?
-            if (aHbPositions[i].x_advance == 0)
+            if (hb_ot_layout_get_glyph_class(aHbFace, nGlyphIndex) == 
HB_OT_LAYOUT_GLYPH_CLASS_MARK)
                 nGlyphFlags |= GlyphItem::IS_DIACRITIC;
 
             aHbPositions[i].x_offset /= 64;

-- 
To view, visit https://gerrit.libreoffice.org/3519
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib935dd571e2191eb5f8ae72650394293dd248140
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Khaled Hosny <khaledhosny@eglug.org>


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.