Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom fonts ignored when exporting #1604

Closed
LinguaOccultus opened this issue Jan 24, 2024 · 14 comments
Closed

Custom fonts ignored when exporting #1604

LinguaOccultus opened this issue Jan 24, 2024 · 14 comments
Labels
blocked/need-repro Requires a complete test case that reproduces the problem

Comments

@LinguaOccultus
Copy link

LinguaOccultus commented Jan 24, 2024

Describe the bug
When exporting a Draw.io Desktop file into another format (PNG in my case) it does ignore custom fonts used in the drawing. I was using »Source Sans 3« from Adobe (free font; available from different locations online) and it is displayed correctly inside Draw.io Desktop. When I fo export the drawing, it is replaced by some default font instead.

HOWEVER, when ONLY inserting this font into an empty drawing, it is imported correctly! I have removed the layers I was using, but that did not solved it. The file is simple: rectangle with border and filling in the background. Over it, an icon I downloaded from Bootstrap Icons (current version 5.3, https://icons.getbootstrap.com/icons/person-fill/) as SVG. The icon was imported into Affinity Designer (vector editor) to change only its color and exported as SVG again. It then was imported into the existing Draw.io Desktop drawing. Finally, over the icon, I put a text box with the custom font. All looks fine, when exporting it, the font is lost and replaced by a default (or at least different) one (with or withou layers).

When exporting as PNG in Draw.io Desktop, I only unchecked to include the drawing (bottom setting).

This especially makes no sense since this is a pixel format; I would expect something like that in a vector format or PDF where the font might missing or something.

To Reproduce
Steps to reproduce the behavior:
(Included above and not making sense separately)

Expected behavior
Obvious.

Screenshots
Inside Draw.io Desktop:
image

Export as PNG result:
image

draw.io version (In the Help->About menu of the draw.io editor):

  • Draw.io Desktop version 22.1.21

Desktop (please complete the following information):

  • OS: Windows 11 Pro 23H2

Additional context
All included above, I guess ...

@GregKGS
Copy link

GregKGS commented Feb 8, 2024

I've found similar. Previously I was using Source Sans 3 via the "Google Fonts" option. Now that directly using Google Fonts isn't available in draw.io, I downloaded and installed Source Sans 3 and changed my diagram to use this font locally.

Despite this (and despite uninstalling/reinstalling draw.io, as well as clicking on "Reset" in the fonts dropdown), I still get the same issue.

I enabled the developer tools, and saw no errors in the console when I exported the png.

Hope the above adds some additional context for triaging.

(I half wonder if draw.io doesn't like fonts with numbers in the title!)

@GregKGS
Copy link

GregKGS commented Feb 8, 2024

As a further discovery:

I have both Source Sans 3 and Source Sans Pro (which apparently is an older variant) installed.

Using "Source Sans Pro", it exports correctly.
Using "Source Sans 3", it doesn't (as shown in the TMA example above).

Perhaps either the Newer Source Sans 3:

  • Contains some new font features that cause the export to fail and fall back to a fallback font; or,
  • The "3" in the name is causing issues.

Hope this helps with triage.

@m-mohamedin
Copy link
Contributor

Somehow, this issue is only with "Source Sans 3"!
We've tried other system and Google fonts and it works as expected.
We'll see if we can fix that

@LinguaOccultus
Copy link
Author

LinguaOccultus commented May 8, 2024

3 similar comments
@LinguaOccultus
Copy link
Author

LinguaOccultus commented May 27, 2024

@LinguaOccultus
Copy link
Author

LinguaOccultus commented May 27, 2024

@LinguaOccultus
Copy link
Author

LinguaOccultus commented Jun 5, 2024

@alderg
Copy link
Contributor

alderg commented Jun 5, 2024

Please attach a test case.

@davidjgraph davidjgraph added the blocked/need-repro Requires a complete test case that reproduces the problem label Jun 5, 2024
@LinguaOccultus
Copy link
Author

LinguaOccultus commented Jun 5, 2024

1 similar comment
@LinguaOccultus
Copy link
Author

LinguaOccultus commented Jun 19, 2024

@kenmcd
Copy link

kenmcd commented Jun 19, 2024

Not likely an issue with the fonts (that would be changed).

Could be an issue with a number in the font name.
Also try Source Serif 4 to see if it has the same issue.
https://github.com/adobe-fonts/source-serif/releases/tag/4.005R
Note: If you were using Source Sans Pro from Google Fonts (GF) than you were using the TTF format.
So try both the OTF and TTF fonts.
Also easy to change the name of the font to test.

If the issue is only with the OTF fonts, that could be because Adobe removed a particular name field from the CFF table in Source Sans 3, and in Source Serif 4 (and in Minion 3 if you have access to that).
This caused an issue in LibreOffice as they used that particular field for PDF exports when the OTF fonts were installed.
This could also be tested by changing that particular name field.
Adobe is not going to change this, so if this is the issue it will have to be fixed here.

First try the TTF fonts and Source Serif 4.
If that has no effect, then we can test some name changes.

@davidjgraph
Copy link
Contributor

davidjgraph commented Jun 20, 2024

24.6.1 adds quotes to font family names.

@LinguaOccultus
Copy link
Author

LinguaOccultus commented Jun 24, 2024

@davidjgraph
Copy link
Contributor

I'll close this up as the original issue is solved for the original poster. If you have further issue(s), you are welcome to add a new issue per problem.

@LinguaOccultus LinguaOccultus changed the title Custom fonts ignored when exporting - Jan 27, 2025
@davidjgraph davidjgraph changed the title - Custom fonts ignored when exporting Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked/need-repro Requires a complete test case that reproduces the problem
Projects
None yet
Development

No branches or pull requests

6 participants