-
Notifications
You must be signed in to change notification settings - Fork 145
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
Glyph vertical alignment issues #161
Comments
Hello @DMartinek , AFAIK this is indeed possible to notice some glyphs vertically mislocated, but this is per glyph only. I've reexported YaHei from the same online converter. In the provided pictures, we can notice that the whole text is progressively offseting itself. And that Im currently not able to reproduce. At first sight, it might look like the camera perspective deformation, or the text or one of its parent has a slight rotation. Try to place the text in front of the camera to see if it can help. |
Hi @swingingtom, thanks for trying to replicate this. Yeah sorry the provided pictures were directly from an application with a perspective camera that's maybe why it seems to get worse over time. I've added some lines to show the issue more clearly. Some glyphs that descend below the base line like the 'g' seem to be offset a lot more than others. It also seems strange that the line height seems to be wrong with that font while it works fine with others: I'm not sure if it is allowed to directly share bitmapfonts due to licensing so I rather not post the files here but I can send them to whoever is interested in replicating the behavior. You can also simply get the font from https://github.com/IBM/plex (I use the sans regular version) and use the online msdf converter to convert it using the following characters: |
This could indeed comes from the library, and is intensified by a specific font. Some toughts I could be totally wrong about @felixmariotto do you have leads on this? I noticed that |
@swingingtom |
A-Frame optionally uses MSDF font files, and their doc lead to the same converter. Here is an A-Frame codepen comparing their default font and our default font (I linked to this repo's files using unpkg). @DMartinek it would be great if you could fork this codepen to show what happens when using the font that has an issue in three-mesh-ui. This way we would know if the issue comes from the converter or from three-mesh-ui. |
my bad. sorry. I did some export from command line. Font size 48, with 2 decimals. Nothing really helped :/ |
Whereas not being able to identify the origin of this issue, 7.x.x would contain a tool to help us to fix those disagreement : https://felixmariotto.github.io/three-mesh-ui/7.x.x/#ex__baseline |
From the issue mention, I am having similar issues with this font attached |
This has been fixed on v6.5.3 The result can be seen here https://codesandbox.io/s/glyphs-vertical-issues-vunz9 Rye font is pretty handy as it has "matching spikes" Aligned (6.5.3) as @DMartinek said, it was especially noticeable with Saira font We can also note a difference of character size. Unfortunately, it doesn't fix alignment issues in Roboto. |
…phic adjustments
Hi everyone!
First thanks for your great work on this library it really helps a lot when developing UIs in VR.
Unfortunately I hit an issue related to fonts. It seems that for some fonts the glyph positioning/metrics aren't correct. The json files generated by the online converter seems to be fine (I also tested it with some of the offline tools, but get the same issues). In my case the error happens with the IBM Plex font but I was able to replicate it with Open Sans too.
It seems that glyphs aren't correctly aligned vertically (and also the horizontal and line advances seem too big).:
This is the same application using the online converters default font (yahei), which doesn't exhibit the issues:
I also tried various options (like kerning/no kerning) etc. but nothing seems to help. The preview of the fonts in the online conversion tool also displays the font correctly.
Did someone else experience something similar? Is it possible that there is some user error on my part, or could there be an error in the libraries font handling?
The text was updated successfully, but these errors were encountered: