migueltk's picture

Fonts sharper with a little modification.

Project:QuickFont - Text Printing and Font Generation Library
Version:0.9.2
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:open
Description

Personally I appreciate small letter fonts are low-sharpening. I suggest to modify the following code:

File: Builder.cs
Row 137: gfx.TextRenderingHint = TextRenderingHint.AntiAlias;

by the following code:

   if (font.Size <= 18.0f)
   {
       gfx.TextRenderingHint = TextRenderingHint.AntiAliasGridFit;
   }
   else
   {
      gfx.TextRenderingHint = TextRenderingHint.AntiAlias;
   }

After changing the letters are much sharper.


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
james_lohr's picture

#1

Thank you for brining this to my attention. This is a good suggestion, although I've noticed that some fonts do not render properly with AntiAliasGridFit (some verticals are deleted, such as the straight in the letter 'd').

Instead I've added a render option to QFontBuilderConfiguration which allows you to specify which TextRenderingHint is used, as the best hint seems to vary depending upon the font in question. This is included in 1.0.0 which I'm about to release.