Skip to content

The Noto Sans CJK TTF font cannot be loaded correctly #1012

@KewenCode

Description

@KewenCode

I'm trying to load a CJK font for text rendering, but when I use the Noto font with TTF, it doesn't work, and no error log.

I believe the reason is the same as in issue #331.

If this turns out not to be a problem with resvg, I'm just leaving this here for reference.

SVG

<svg id="svg1" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg" font-family="Noto Sans CJK SC (replace with different font)" font-size="32">

      <title>Simple case</title>

      <path id="crosshair" d="M 20 100 L 180 100 M 100 20 L 100 180" stroke="gray" stroke-width="0.5" />

      <text id="text1" x="100" y="30" >【测试】</text>

      <!-- image frame -->
      <rect id="frame" x="1" y="1" width="198" height="198" fill="none" stroke="black" />

</svg>

Result

Noto Sans CJK SC (TTF) Noto Sans CJK SC (OTF) Source Han Sans HW SC (OTF)
Output Image Image Image
Log Image Image Image
FontForge Image Fail to load Image
Download NotoSansCJKsc-VF NotoSansCJKsc-VF Language Specific HW OTFs Simplified Chinese (简体中文)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions