Commit Graph

11 Commits

Author SHA1 Message Date
urhobot
f861a10a61 GH Actions: Bump copyright to 2021. 2021-07-17 16:43:46 +00:00
urho3d-travis-ci
1151b8a2d6 Travis CI: bump copyright to 2020. 2020-01-05 06:21:40 +00:00
urho3d-travis-ci
a476f0c401 Travis CI: bump copyright to 2019. 2019-01-12 01:00:16 +00:00
urho3d-travis-ci
70049ba582 Travis CI: bump copyright to 2018.
[cache clear]
2018-01-01 05:35:37 +00:00
Yao Wei Tjong 姚伟忠
d6eb307e34 Clang-Tidy - google-explicit-constructor. 2017-12-31 13:48:28 +08:00
Yao Wei Tjong 姚伟忠
5e89e566e6 Clang-Tidy - modernize-use-override. 2017-12-31 12:11:09 +08:00
Eugene Kozlov
59391f9523 Source/Tools and Source/Samples automatic upgrade: override, typedef to using, 0 to nullptr. 2017-08-29 11:40:46 +03:00
Iain Merrick
0450bcd11e Add configurable oversampling to improve subpixel font rendering (#1953)
Subpixel-positioned text looks blurry, due to bilinear filtering of the
underlying texture. The basic idea here is to stretch the font glyphs
horizontally to increase the sharpness at subpixel positions. The
stretched images need to be smoothed to avoid aliasing artifacts; this
is done in FontFaceFreeType::BoxFilter().

Glyphs are always pixel-aligned vertically, so no vertical oversampling
is needed.

To make this feature comprehensible (I hope!) I've removed the
'subpixelGlyphPositions' flag and replaced it with a couple of values:
'fontSubpixelThreshold' sets the point at which subpixel positioning
kicks on, and 'fontOversampling' controls the amount of stretching.

The default values are 12pt text and 2x oversampling. These are fairly
conservative settings, which should improve small text without wasting
a lot of memory.

Note that when the font hint level is NORMAL (the default), subpixel
positioning and oversampling are both disabled. So, this feature doesn't
change any default behavior, and applies some hopefully sensible values
if the hint level is set to LIGHT or NONE.
2017-07-03 11:21:47 -05:00
Iain Merrick
e603eed814 Add a 'subpixel glyph positions' option to UI (#1953)
When this option is enabled, text will be formatted with subpixel
(fractional) positions on the x-axis. Positions on the y-axis are
still pixel-aligned.

Note that this option has no effect if the hinting level is set
to FONT_HINT_LEVEL_NORMAL, as each glyph is rounded to an integral
pixel size by the hinter. It only makes a different if the hinting
mode is LIGHT (vertical hinting only) or NONE.

With subpixel positioning, the output will look blurrier due to
texture filtering. TODO: Add horizontal oversampling to improve
sharpness. That needs extra memory so it should be configurable.
2017-06-20 17:04:56 -05:00
Iain Merrick
282f250e3a Add UI.FontHintLevel property
There are three levels: NORMAL (the default), LIGHT and NONE.
The LIGHT level makes FreeType align font outlines to pixel
boundaries vertically, but not horizontally.
2017-06-15 15:30:28 -05:00
Iain Merrick
a476c43a24 Add a 'Typography' sample program
Displays text in various sizes, with checkboxes to play with settings
that affect the way text is rendered:
- Color (white-on-black versus black-on-white)
- Autohinter
- sRGB output conversion (not available on all platforms)
2017-06-13 13:40:22 -05:00