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

[FontTTF] Fixed a blurry font which is happening sometimes in some cases. #7784

Merged
merged 2 commits into from Aug 14, 2015

Conversation

Projects
None yet
3 participants
@afedchin
Copy link
Member

afedchin commented Aug 10, 2015

see title

The caching font data mechanics allows have vertices with negative X coordinate. Here is an example of real vertices data for the same character:

Char is not blurry:

#float3(x,y,z),float4(r,g,b,a),float2(tu,tv)
"{+72, +124, +0}","{+0.89803928, +0.89803928, +0.89803928, +1}","{+0.13085938, +0.30000001}"
"{+77, +124, +0}","{+0.89803928, +0.89803928, +0.89803928, +1}","{+0.13574219, +0.30000001}"
"{+77, +138, +0}","{+0.89803928, +0.89803928, +0.89803928, +1}","{+0.13574219, +0.76666671}"
"{+72, +138, +0}","{+0.89803928, +0.89803928, +0.89803928, +1}","{+0.13085938, +0.76666671}"

Char is blurry:

#float3(x,y,z),float4(r,g,b,a),float2(tu,tv)
"{-159, +124, +0}","{+0.89803928, +0.89803928, +0.89803928, +1}","{+0.13085938, +0.30000001}"
"{-153, +124, +0}","{+0.89803928, +0.89803928, +0.89803928, +1}","{+0.13574219, +0.30000001}"
"{-153, +138, +0}","{+0.89803928, +0.89803928, +0.89803928, +1}","{+0.13574219, +0.76666671}"
"{-159, +138, +0}","{+0.89803928, +0.89803928, +0.89803928, +1}","{+0.13085938, +0.76666671}"

As can you see if vertex data has negative value of X coordinate the dimension of char is greater at 1 pixel - 6x14 instead of 5x14.

It would be helpful if some one can test this on linux

afedchin added some commits Aug 10, 2015

[GUIFontTTF] Fixed rounding X coordinate of a char if it has negative…
… value.

Now caching font data algorithm allows negative coordinates of vertices. Rounding X coord does not consider negative values and it causes a font blurry in some cases.
@mkortstiege

This comment has been minimized.

Copy link
Member

mkortstiege commented Aug 11, 2015

Runtime tested on Linux without an issue.

@MartijnKaijser

This comment has been minimized.

Copy link
Member

MartijnKaijser commented Aug 11, 2015

no problems so far on win32

@MartijnKaijser

This comment has been minimized.

Copy link
Member

MartijnKaijser commented Aug 11, 2015

jenkins build this please

@MartijnKaijser MartijnKaijser added this to the Jarvis 16.0-alpha2 milestone Aug 12, 2015

@MartijnKaijser

This comment has been minimized.

Copy link
Member

MartijnKaijser commented Aug 14, 2015

can we merge this?

@afedchin

This comment has been minimized.

Copy link
Member Author

afedchin commented Aug 14, 2015

@MartijnKaijser I think so. should the first commit be backported?

MartijnKaijser added a commit that referenced this pull request Aug 14, 2015

Merge pull request #7784 from afedchin/fix_font_blurry
[FontTTF] Fixed a blurry font  which is happening sometimes in some cases.

@MartijnKaijser MartijnKaijser merged commit 61ce873 into xbmc:master Aug 14, 2015

1 check passed

default Merged build finished.
Details
@MartijnKaijser

This comment has been minimized.

Copy link
Member

MartijnKaijser commented Aug 14, 2015

don't know. Not sure if i've seen it on 15.x as well.

@afedchin afedchin deleted the afedchin:fix_font_blurry branch Aug 14, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.