Skip to content

non win-1252 characters in SVG #777

Description

@nbkolchin

Asciidoctor input:

[blockdiag, format="svg"]
.Пример диаграммы
----
blockdiag {
  A[label="изображение"];
  B[label="color filtering"];
  A -> B;
}
----

Theme file:

font:
  catalog:
    PTAstraSerif:
      normal: PTAstraSerif-Regular.ttf
      bold: PTAstraSerif-Bold.ttf
      italic: PTAstraSerif-Italic.ttf
      bold_italic: PTAstraSerif-BoldItalic.ttf
  fallbacks:
    - PTAstraSerif
base:
  font_family: PTAstraSerif

Generated svg:

...
  <text fill="rgb(0,0,0)" font-family="sans-serif" font-size="11" font-style="normal" font-weight="normal" text-anchor="middle" textLength="64" x="320" y="67">color filtering</text>
...

Asciidoctor execution:

$ asciidoctor-pdf \
    -a pdf-style=$HOME/.asciidoctor/themes/basic-theme.yml \
    -a pdf-fontsdir=$HOME/.asciidoctor/fonts \
    -r asciidoctor-diagram \
    test.adoc
The following text could not be fully converted to the Windows-1252 character set:
| изображение

There is no way to specify SVG font for 'blockdiag', it will always use "sans-serif".

Afaik, there is no way to replace default "sans-serif" in asciidoctor.

If I manually edit generated svg and change "sans-serif" with "PTAstraSerif", everything work without errors.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions