-
Notifications
You must be signed in to change notification settings - Fork 2
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
Support for Rendering Glyphs with Non 1:2 Aspect Ratio #1
Comments
Thank you very much for your issue. This is true for the current situation. Supporting non-standard Latin characters is a very tempting feature. However, the main work at the moment is in more complete support the control functions of the terminal based on Xterm Control Sequences (including rollback buffers, [possible] mouse support and so on). Thus better management for glyph rendering may be postponed until after this refinement work. This issue will not close until the feature is complete. |
Hi, I'm glad I've made a little progress on the rendering of characters such as CJK. AFAIK that the terminal manages character display in terms of cells, with half-width characters using one cell and full-width characters using two cells (the first cell uses the space of both cells when rendering, while the second cell is labelled as a placeholder and will be skipped when rendering). Because of this special cell-based management model, I cannot use common text layout crates such as I have made this terminal library support full-width characters as described above for cell. The current drawback is the determination of whether or not a character need to use two cells. I currently use the The solution is to call This issue might be tackled in a later version. So if you just need a common layout solution, you can try to use |
Thank you very much for your work! This is obviously not a very "clean" job, but it's better to have it than not! After all, CJK typesetting, punctuation squeezing and glyph adjustment are obviously not necessary for a terminal, and these things should be handled by more advanced typesetting software. Regarding how to distinguish between full-width and half-width characters, I think if only |
Thank you for this excellent terminal library! I'm currently working on rendering Chinese characters and emojis. However, I'm encountering an issue where the default assumption seems to be that the glyphs should have a 1:2 width-to-height ratio, but this isn't the case for many fonts, especially when rendering CJK characters or emojis.
I noticed that ab_glyph::ScaleFont.h_advance takes a GlyphId parameter, which suggests that the glyph's advance width is not fixed. Is there a recommended way to handle the rendering of glyphs that do not adhere to the 1:2 width-to-height ratio? Any guidance or best practices would be greatly appreciated!
The text was updated successfully, but these errors were encountered: