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

More robust. eg. loading wqy-microhei.ttc #654

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

neoedmund
Copy link

No description provided.

@nothings
Copy link
Owner

Does this fix a bug?

@nothings
Copy link
Owner

Oh, I see from the title the implication is it does. Can you be specific about what character at what size fails?

@neoedmund
Copy link
Author

neoedmund commented Sep 11, 2018

  1. The font file "wqy-microhei.ttc" is from
    https://packages.ubuntu.com/xenial/all/fonts-wqy-microhei/filelist , it contains thousands of Unicode CJK characters and the font should be widely used.

  2. I tested with imgui which uses stb_truetype.h , it seems try to load all characters to generate a large texture for rendering in opengl.

  3. I don't know how this code(stb_truetype.h) works, and what is it about. But after change the code, It seems worked good. (the font size is 16.0f)
    The values(z->ey, scan_y_top) be skipped are:

-13.187839 , -11.000000
-11.855061 , -11.000000
-11.228655 , -11.000000
-11.088713 , -11.000000
-12.321533 , -11.000000
-12.321533 , -11.000000
-12.321533 , -11.000000
-12.321533 , -11.000000
-11.002083 , -11.000000
-11.002083 , -11.000000
-12.001666 , -12.000000
-12.208246 , -12.000000
-12.468139 , -11.000000
-12.394835 , -11.000000
-11.588505 , -11.000000
-11.588505 , -11.000000
-16.912952 , -12.000000
-16.912952 , -12.000000
-14.733861 , -12.000000
-14.733861 , -12.000000
-13.134527 , -12.000000
-13.134527 , -12.000000
-12.048313 , -12.000000
-12.194919 , -12.000000
-12.408163 , -12.000000
-12.041650 , -12.000000
-11.301957 , -11.000000
  1. hope this helps.

@nothings
Copy link
Owner

nothings commented Feb 7, 2019

This seems like it's hiding an actual bug, since it implies some edges are discarded without ever being processed. I'll need to look at the actual cases that are failing (I can figure out for myself from the above info, I think).

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

Successfully merging this pull request may close these issues.

3 participants