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):

  • Version: 22.1.21

Desktop (please complete the following information):

  • OS: Windows 11 Pro 23H2

Additional context
All included above, I guess ...

However, there seem to be several issues with exporting currently as the problems with changed colors for PDF exports I also can confirm. Maybe this is in context to that ... ?

@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

I do not have more information I could provide here. I was just surprised myself that Google seems to have replaced the Pro with the 3 font as the first is not available on Google Fonts anymore (and its repository here says the same).

So, the only thing which seems to be special about this case seems to be the replacement. And maybe they changed something about this font internally which Draw.io Desktop cannot handle for whatever reason. Remembering that even fonts do have meta data and more to them as it seems leaves some room for possible causes.

We also might just ask them: https://github.com/adobe-fonts/source-sans

@LinguaOccultus
Copy link
Author

Today I found that the old error of font color is also back ... AGAIN! :-D I post it here for the moment as I have seen it while using Source Sans 3 which seems to be making more issues aside from that as discussed above. But probably this is a general problem again, as we had it several times before. Yes, I am working using the Dark Mode enabled, so it might be related to that again. However, my text has the color FFFFFF (white) explicitly defined for it this time (no auto color). Draw.io Desktop version in questions is currently 24.4.8 ... and the font mentioned is still wether printed nor exported (PDF, for example); just to update the main topic here, too.

@LinguaOccultus
Copy link
Author

It even seems it now replaces the color of the text inside the document when printing as my white text was black after the print out. However, text in other colors does seem to be not affected.

@LinguaOccultus
Copy link
Author

LinguaOccultus commented Jun 5, 2024

Just tested again and still an issue in 24.4.13. Any news on this? I am asking because I need to know if I should completely reaplace the font or there is still hope to getting is usable for file export (PDF) ... ?

@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

There's one in my initial post? Situation is still the same ... Source Sans 3 is ignored and replaced when printing or exporting. But since the issue is open for some time I am thinking about replacing the font then instead. On the other hand, if it gets fixed in the near future, it would be no good idead replacing the font in all our documents now. ;-)

Anyway:

Image 1: In Draw.io Desktop 24.4.13, Source Sans 3 font
SS3 01

Image 2: Exported PDF-Result, replaced by some default font
SS3 02

Is there anything one could do wrong here? This always worked this way and still does with other fonts; even Source Code pro, for example:

Image 3: Source Code Pro; still same font in exported PDF ...
image

Also, Source Sans Pro worked and works as mentioned above; Source Sans 3 just is its newest version.

@LinguaOccultus
Copy link
Author

I started an issues over at the GitHub of the Source Sans 3 repository to try to get information helpful to solve this issue. It can be found here:

https://github.com/adobe-fonts/source-sans/issues/278

@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

I can confirm, at least on my end, that 24.6.1 has solved the external font bug with exporting/printing a file. Thanks for the detailed ideas for testing I was about to do today, but I guess this makes the testing obsolete. ;-)

However, now the issue with the black/white replacement is back (maybe also again in context with the dark theme) we had several times before. The difference between the dotted lines below is, that the correctly displayed white one has an explicitely set color of FFFFFF and the other is »automatic« (F0F0F0).

image

@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.

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