Skip to content

Commit 3150269

Browse files
committed
[parser] Fix handling of whitespace glyphs in text primitive.
1 parent 710ea6b commit 3150269

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

source/parser/parser.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/// @parblock
99
///
1010
/// Persistence of Vision Ray Tracer ('POV-Ray') version 3.8.
11-
/// Copyright 1991-2019 Persistence of Vision Raytracer Pty. Ltd.
11+
/// Copyright 1991-2021 Persistence of Vision Raytracer Pty. Ltd.
1212
///
1313
/// POV-Ray is free software: you can redistribute it and/or modify
1414
/// it under the terms of the GNU Affero General Public License as
@@ -6202,6 +6202,11 @@ ObjectPtr Parser::Parse_TrueType ()
62026202
{
62036203
auto controlPoints = fontFace->GetCubicBezierOutline(glyph);
62046204

6205+
if (controlPoints.size() == 0)
6206+
// glyph is whitespace
6207+
continue;
6208+
6209+
// Font module produces control points in the wrong order.
62056210
for (size_t i = 0; i < controlPoints.size() / 2; ++i)
62066211
std::swap(controlPoints[i], controlPoints[controlPoints.size() - i - 1]);
62076212

0 commit comments

Comments
 (0)