From b88b59b4c7fc5b4b11a393c9d0353a0b8d6e35e3 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Fri, 20 Sep 2019 09:47:46 +0200 Subject: Handle SVG in OpenType fonts where glyphs have floating point numbers in 'viewBox'. --- src/libnrtype/FontInstance.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libnrtype') diff --git a/src/libnrtype/FontInstance.cpp b/src/libnrtype/FontInstance.cpp index 5a3d5aa9f..b58d54788 100644 --- a/src/libnrtype/FontInstance.cpp +++ b/src/libnrtype/FontInstance.cpp @@ -699,7 +699,7 @@ Inkscape::Pixbuf* font_instance::PixBuf(int glyph_id) Glib::ustring svg = glyph_iter->second.svg; Glib::RefPtr regex = - Glib::Regex::create("viewBox=\"\\s*(\\d*)\\s*,?\\s*(\\d*)\\s*,?\\s*(\\d*)\\s*,?\\s*(\\d*)\\s*\""); + Glib::Regex::create("viewBox=\"\\s*(\\d*\\.?\\d+)\\s*,?\\s*(\\d*\\.?\\d+)\\s*,?\\s*(\\d+\\.?\\d+)\\s*,?\\s*(\\d+\\.?\\d+)\\s*\""); Glib::MatchInfo matchInfo; regex->match(svg, matchInfo); if (matchInfo.matches()) { -- cgit v1.2.3