Comments (16)
It's certainly possibly that there's a bug in my interpreter. Other things to check though: are there embedded bitmaps at this strike size? Also remember that GDI has 3x horizontal resolution thanks to ClearType. You can kind of simulate what the interpreter will do by just giving it 3x more horizontal DPI.
I would try verifying against FreeType and DirectWrite. DWrite has modes to render without ClearType and usually more closely matches what's actually in the font data.
For the blurry stems, that's all about positioning on a pixel boundary. Your layout algorithm probably needs to be smarter about subpixel advances.
from typography.
contour analysis2, with polytri-cs (https://github.com/PaintLab/poly2tri-cs)
small yellow points => center of each triangle
from typography.
- port SharpFont's TrueType Hinting (https://github.com/MikePopoloski/SharpFont)
I've tested it :), Tahoma, 8 pts
from the picture,
PixelFarm's Typography now supports TrueType Hinting,
from typography.
I think, I need to fix the Hinting!
It not as clear as expect. :(
from typography.
@MikePopoloski ,
Thank you for your attention. :)
I bring TrueType Hinting code from your repo.
(now locate in https://github.com/LayoutFarm/Typography/blob/master/NetCore/PixelFarm.OpenType/TrueTypeInterperter/Interpreter.cs).
I don't change the inner logic.
I found the the hinted result look blur and
not as clear as expect. (see above).
Do you have any suggestions about how to fix that?
from typography.
It works correctly in my repo right? I see that you've changed the code, so I can only assume you've introduced a bug or aren't handling some part of the font parsing correctly.
from typography.
closer look :)
compare side-by-side.
- SharpFont: Hinted-> use bitmap texture. (fix pixel position)
- PixelFarm's Typography: Hint -> render each glyph vertex buffer directly to canvas (vary in glyph pixel position)
- MS Notepad : reference
Tahoma, 11 pts.
each hinted glyphs are very similar.
diff in glyph spacing-> I will fix it later.
I think both of them have the same hint problem.
eg. 'k' glyph -> left upper 'arm' is not sharp
I will investigate further.
goals: to improve glyph quality in both libs
from http://www.antigrain.com/research/font_rasterization/
(Maxim Shemanarev's Agg)
...
This is how the patented aggressive hinting works for the nominal size of 13 pixels. This is why the strokes in “k” look so fragile, almost invisible.
from typography.
from typography.
Thank you so much :)
from typography.
(Maxim Shemanarev's Agg)
in short...
So, in short words, for the nice looking text with accurate horizontal positioning we need the following.
1. Use horizontal RGB sub-pixel anti-aliasing for LCD flat panels.
2. Use vertical hinting only and completely discard the horizontal one.
3. Use accurate glyph advance values, calculated at a high resolution for unhinted glyphs.
4. Use accurate, high resolution values from the kerning table.
...
To keep vertical hinting but discard horizontal we simply cheat the hinter. We stretch the symbols horizontally so that, the hinter would have to work with high accuracy in the X direction
...
So, I want to ask David Turner, maybe it makes sense to add an option to his auto-hinter that would modify the Y-direction only, completely discarding the X coordinates. It even can be a special, 1-D hinter that is supposed to be much simpler than the existing one.
related resource : http://jcgt.org/published/0002/01/04/paper.pdf
from typography.
Attempt to do AutoFit,
(without original TrueType instruction).
connected centroid1
connected centroid 3
connected centroid 4
glyph 'm' edges analysis by triangulation
we can separate inside, outside edges
from typography.
Maxim's Agg Vertical Hinting
(font: Tahoma, 8pts)
from typography.
For glyph outline tessellation, you may want to try https://github.com/speps/LibTessDotNet. It works well on .NET core.
from typography.
Glyph 'a' :
autofit + vertical hinting + agg's subpixel rendering
Need some color adjustment :)
from typography.
Preview Latest AutoFit + SubPixelRendering
pic 1: Tahoma, 8 pt, (1) No AutoFit , (2) with AutoFit,
Tahoma, 10pt, (3) No AutoFit, (4) with AutoFit
from 1, you can see horizontal stem of 'e' in (4) is sharper than (3)
from typography.
Preview, Gdi+ vs the Typography
Windows Gdi+ image (SubPixel Rendering, LCD technique) and its zoom pic.
vs PixelFarm's Typography Glyph Rendering, with Vertical AutoFit + Horizontal Fit alignment.
Tahoma 8 pts.
pic 1: upper(1) Gdi+ vs (2) Typography subpixel (lcd) rendering vs (3) Typography gray-scale
Visit the old problem (above), r-r-r sequence
pic 2: Dec 2016, Tahoma 11 pts
pic 3: May 2017, Tahoma 11 pts
TrueType Instruction vs Typography's AutoFit
pic 5: TrueType Instruction Hinted Glyph (Dec 2016), Tahoma 11 pts
pic 6: Typography's AutoFit, with some inter-glyph err at q-u, f-o, and text is too bold
pic 7: Typography's AutoFit + Lcd SubPixelRendering, Tahoma 8pts with some inter-glyph err at w-n
Tahoma 8 pts,
pic 8: vertical-autofit, and horizontal fit alignment
pic 9: vertical-autofit, NO horizontal fit alignment
pic 10: vertical-autofit, and horizontal fit alignment
from typography.
Related Issues (20)
- Surrogates after whitespaces should revert to WordKind Unknown in TextBreak HOT 6
- Where is `GlyphLayout.ReadOutput` now? HOT 5
- C# implementation of path rendering HOT 2
- WordBreak bug HOT 1
- Word Break Bug, accented characters HOT 1
- Caching unscaled path HOT 2
- Line breaking for „ and “ HOT 8
- DPI and final pixels size calculation? HOT 1
- Review "Internationalized String Preparation"
- Avoid closing stream by OpenFontReader.ReadPreview HOT 1
- Is this a correct way to calculate the actual line-height of a typeface in specific font size? HOT 3
- how should I use this? HOT 1
- [Question] Type2 hintmask and cntmask HOT 14
- GetGlyphIndex sets a dictionary value and can fail
- Support more scripts, e.g. Cyrillic, in TextBreaker by default
- How to split a string into different WritingSystems/ScriptRuns ?
- the GlyphPointF structure did not make the onCurve public.
- Convert glyph outlined path to single line bezier path HOT 1
- How can we get OS/2 and HeadTable from Typeface?
- Does library supports Contextual Alternates (calt)?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from typography.