Handling edge case of negative fonts in PDF (59040229) · 提交 · Inkscape / inkscape · GitLab
Martin Owens
·
2026-05-05
·
via Martin Owens activity
| 原始行号 |
差异行号 |
差异行 |
|
@@ -1360,12 +1360,13 @@ void SvgBuilder::updateStyle(GfxState *state) { |
|
|
void SvgBuilder::updateFont(GfxState *state, std::shared_ptr<CairoFont> cairo_font, bool flip)
|
|
|
{
|
|
|
TRACE(("updateFont()\n"));
|
|
|
updateTextMatrix(state, flip); // Ensure that we have a text matrix built
|
|
|
// If the font size is negative, don't flip
|
|
|
auto new_font_size = state->getFontSize();
|
|
|
updateTextMatrix(state, flip && new_font_size > 0); // Ensure that we have a text matrix built
|
|
|
|
|
|
auto font = state->getFont(); // GfxFont
|
|
|
auto font_id = font->getID()->num;
|
|
|
|
|
|
auto new_font_size = state->getFontSize();
|
|
|
if (font->getType() == fontType3) {
|
|
|
const auto& font_matrix = font->getFontMatrix();
|
|
|
if (font_matrix[0] != 0.0) {
|
|
@@ -1373,7 +1374,7 @@ void SvgBuilder::updateFont(GfxState *state, std::shared_ptr<CairoFont> cairo_fo |
|
|
}
|
|
|
}
|
|
|
if (new_font_size != _css_font_size) {
|
|
|
_css_font_size = new_font_size;
|
|
|
_css_font_size = fabs(new_font_size);
|
|
|
_invalidated_style = true;
|
|
|
}
|
|
|
|
|
|
| 原始行号 |
差异行号 |
差异行 |
|
@@ -1138,6 +1138,7 @@ if(WITH_POPPLER) |
|
|
add_pdfinput_test(Annot_w_AP_CMYK all draw-all IN_FILE "Annot_w_AP")
|
|
|
add_pdfinput_test(clipping_shift 1 keep)
|
|
|
add_pdfinput_test(layers-in-xobj 1 substitute EXTRA "--pdf-group-by=layer")
|
|
|
add_pdfinput_test(negative-font-size 1 draw-all)
|
|
|
endif()
|
|
|
|
|
|
function(add_pdfoutput_test name)
|
|
|
加载中
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。