From 4798be914c35620d16cf51170de74d240d1ee347 Mon Sep 17 00:00:00 2001 From: Artem Pavlenko Date: Mon, 3 Jun 2024 12:47:34 +0100 Subject: [PATCH] Set default `font-size` -> 16px/1em --- src/svg/svg_parser.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/svg/svg_parser.cpp b/src/svg/svg_parser.cpp index 1f08a7256..c5575c0c7 100644 --- a/src/svg/svg_parser.cpp +++ b/src/svg/svg_parser.cpp @@ -293,7 +293,7 @@ bool parse_font_size(T& parser, char const* str) css_relative_size relative; std::size_t size = parser.font_sizes_.size(); - double parent_font_size = size > 1 ? parser.font_sizes_[size - 2] : 10.0; + double parent_font_size = size > 1 ? parser.font_sizes_[size - 2] : 16.0; // medium/16px const char* cur = str; // phrase_parse mutates the first iterator const char* end = str + std::strlen(str); @@ -1645,7 +1645,8 @@ svg_parser::svg_parser(svg_converter_type& path, bool strict) , css_style_(false) , err_handler_(strict) { - font_sizes_.push_back(10.0); + font_sizes_.push_back(16.0); // default medium/16px + //https://developer.mozilla.org/en-US/docs/Web/CSS/font-size#values } svg_parser::~svg_parser() {}