summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHerbert Dürr <hdu@apache.org>2013-10-04 15:14:22 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-10-14 10:56:42 +0000
commitd6c7bbf152112aadb70f5bf66c4c9f036790d12d (patch)
tree28e09f7a43ea8c5f8548440d22d116a9bc392988
parent2d4814ca36e52da3681fb369277243ae193085cc (diff)
Resolves: #i123417# handle subsetting of empty ttf compound glyphs gracefully
(cherry picked from commit d519b07ecd4b67cedf1fe3e1860ef33a48a01ae4) Signed-off-by: Caolán McNamara <caolanm@redhat.com> Conflicts: vcl/source/fontsubset/sft.cxx Change-Id: I51d4a97f1f01be49cb5ab058019cd153e23437bd (cherry picked from commit 6489f97fc428446c53c17f885963776cdcc21490) Signed-off-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit d4b7546df3f9650b1773b9ad0cdd93aa01ae1097) Reviewed-on: https://gerrit.libreoffice.org/6219 Reviewed-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r--vcl/source/fontsubset/sft.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index e110c1225a12..a8e8e005342d 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -745,7 +745,10 @@ static int GetCompoundTTOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPo
} while (flags & MORE_COMPONENTS);
-
+ // #i123417# some fonts like IFAOGrec have no outline points in some compound glyphs
+ // so this unlikely but possible scenario should be handled gracefully
+ if( myPoints.empty() )
+ return 0;
np = myPoints.size();
@@ -2620,7 +2623,7 @@ GlyphData *GetTTRawGlyphData(TrueTypeFont *ttf, sal_uInt32 glyphID)
/* now calculate npoints and ncontours */
ControlPoint *cp;
n = GetTTGlyphPoints(ttf, glyphID, &cp);
- if (n != -1)
+ if (n > 0)
{
int m = 0;
for (int i = 0; i < n; i++)