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

node.Label.FontSize fails render proeprly when exporting to svg #351

Open
wvdvegt opened this issue Jul 18, 2023 · 2 comments
Open

node.Label.FontSize fails render proeprly when exporting to svg #351

wvdvegt opened this issue Jul 18, 2023 · 2 comments

Comments

@wvdvegt
Copy link

wvdvegt commented Jul 18, 2023

node.Label.FontSize fails render proeprly when exporting to svg especially when the fontsize is less then the default (I used 8).

Expected:
image

but got:

image

The export to SVG works nicely if I do not set the FontSize.

@levnach
Copy link
Contributor

levnach commented Jul 22, 2023

I do not know how to tackle this. I do not know how to measure a text string in a specific font for SVG export.

@wvdvegt
Copy link
Author

wvdvegt commented Jul 24, 2023

The bonding box is not the issue, i think it's size is ok. But the font size is not rendered correctly (to big for the node so overflowing). So i think the issue is related on what happens in WriteLabel.

The following 3 lines are clearly not writing a correct font size reflecting the node's Font Size.

var fontSize = 16;
WriteAttribute("font-size", fontSize);
WriteLabelText(label.Text, x, fontSize);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants