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

Fix text not appearing when requested font is not in font table #972

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

DanRod1999
Copy link
Contributor

Resolves
When a font is requested for text but it is not in the dgn_font table the text does not get displayed.

I believe it is due to the fontId being set to zero in itwinjs-core when the requested font is not found. Code here

Because of this when generating the opcodes for the geom stream, the invalid id is caught and the opcode for drawing a text view is not added to the Geom Stream io collection.

I do not know if this is the best solution, or if core should not use 0 for this fontId.

@markschlosseratbentley
Copy link
Contributor

What does font id 0 mean? If we do not throw an error, and instead actually use font id 0 alongside the text opcode, have you seen what font it will use?

@markschlosseratbentley
Copy link
Contributor

What does font id 0 mean? If we do not throw an error, and instead actually use font id 0 alongside the text opcode, have you seen what font it will use?

Never mind - I saw your other comment elsewhere about the fallback font it will use. Can we rely on this being the case always? (I hope so).

Copy link
Member

@pmconne pmconne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comments on the issue. We don't want to allow people to insert text strings with font Id 0.

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

Successfully merging this pull request may close these issues.

3 participants