Font Kerning
Font Kerning
Font Kerning
Font Kerning
Font Kerning
Font Kerning Font Kerning Font Kerning Font Kerning Font Kerning Font Kerning Font Kerning Font Kerning
Font Kerning Font Kerning
Font Kerning
Go Back  Xtreme Visual Basic Talk > > > Font Kerning


Reply
 
Thread Tools Display Modes
  #1  
Old 02-10-2017, 03:32 PM
mms mms is offline
Ultimate Contributor
 
Join Date: Jul 2002
Location: Hamilton, Ontario
Posts: 1,859
Default Font Kerning


I was outputting text in my program (using GDI+), and noticed the output was not being kerned.
I then tested using GDI functions - same result, no kerning.
I also tested using a simple label and the intrinsic Caption Method - again no kerning.

If I output text directly to the form using the form's print object, then kerning is used.

Am I missing some setting, or something, using the api methods, and the Label1.Caption Method, that causes kerning to be turned off?
Reply With Quote
  #2  
Old 02-13-2017, 02:33 AM
Flyguy's Avatar
FlyguyFont Kerning Flyguy is offline
Lost Soul

Super Moderator
* Guru *
 
Join Date: May 2001
Location: Vorlon
Posts: 19,164
Default

What font are you using?
Reply With Quote
  #3  
Old 02-13-2017, 06:57 AM
mms mms is offline
Ultimate Contributor
 
Join Date: Jul 2002
Location: Hamilton, Ontario
Posts: 1,859
Default

I am using Times New Roman.
I tested many other fonts as well, and never any kerning applied.
Reply With Quote
  #4  
Old 02-13-2017, 07:56 AM
Flyguy's Avatar
FlyguyFont Kerning Flyguy is offline
Lost Soul

Super Moderator
* Guru *
 
Join Date: May 2001
Location: Vorlon
Posts: 19,164
Default

A Google Search gives a lot of hits, one of them:
http://www.codeguru.com/cpp/g-m/gdi/...bout-Fonts.htm

Also check this thread:
DrawString Spacing Between Individual Characters
Reply With Quote
  #5  
Old 02-13-2017, 08:43 AM
mms mms is offline
Ultimate Contributor
 
Join Date: Jul 2002
Location: Hamilton, Ontario
Posts: 1,859
Default

Thanks Flyguy, I will read through those documents.

I'm thinking that Windows itself does not apply kerning to text.
I just checked using both Microsoft Word and Excel - no kerning is applied,
even though kerning values are present in the font's kerning tables.

The only place I see kerned text is using VB's Printer object (ie Form1.Print "VAV")

Strange I think.
Reply With Quote
  #6  
Old 02-13-2017, 01:11 PM
Cerian Knight's Avatar
Cerian KnightFont Kerning Cerian Knight is offline
Polymath (in disciplina)

Super Moderator
* Expert *
 
Join Date: May 2004
Location: Michigan
Posts: 4,193
Default

I checked 'Garamond' (a font mentioned in Flyguy's first link). Kerning seems to be applied properly by Windows.

I was thinking to revise my FontTool to detect if kerning is honored (e.g., based on rendering 'VA'), but probably more trouble than it is worth.
http://www.xtremevbtalk.com/1255385-post8.html

The last update was required to manage new fonts included with Vista+ that could render with zero height (i.e. divide by zero error).
__________________
I got all the answers wrong on the GLAT, apparently even #9 (where I put a period in the middle of the box and labeled it 'singularity ripe for rapid inflation').
Reply With Quote
  #7  
Old 02-13-2017, 04:12 PM
mms mms is offline
Ultimate Contributor
 
Join Date: Jul 2002
Location: Hamilton, Ontario
Posts: 1,859
Default

So perhaps there is some setting in Windows Control Panel that I don't have set (I'm running Windows 7),
because for me no kerning is applied using Garamond, only Times New Roman and only using Forms's Printer Object.

As I've stated before, same happens outside VB environment, (ie in Word and Excel)

Code:
Private Sub Command1_Click()

    Dim font As String
    font = "Times New Roman"
    
    Me.FontName = font
    Me.FontSize = 48
    Me.Print "VAV"
    
    Label1.FontName = font
    Label1.FontSize = 48
    Label1.Caption = "VAV"

End Sub
Code for the two screenshots.
Attached Images
File Type: png TNR.png (16.9 KB, 4 views)
File Type: png G.png (12.0 KB, 4 views)

Last edited by mms; 02-13-2017 at 04:17 PM.
Reply With Quote
  #8  
Old 02-14-2017, 06:52 AM
Flyguy's Avatar
FlyguyFont Kerning Flyguy is offline
Lost Soul

Super Moderator
* Guru *
 
Join Date: May 2001
Location: Vorlon
Posts: 19,164
Default

If have the same results on Windows 7 Pro 32bit
Font "Arial" also looking good with Me.Print
Reply With Quote
  #9  
Old 02-14-2017, 10:16 AM
Cerian Knight's Avatar
Cerian KnightFont Kerning Cerian Knight is offline
Polymath (in disciplina)

Super Moderator
* Expert *
 
Join Date: May 2004
Location: Michigan
Posts: 4,193
Default

Sorry, I was dyslexic with regard to kerning. You are correct, indeed no kerning is being applied to Garamond (which conflicts with the article). Hmm...
__________________
I got all the answers wrong on the GLAT, apparently even #9 (where I put a period in the middle of the box and labeled it 'singularity ripe for rapid inflation').
Reply With Quote
  #10  
Old 02-14-2017, 11:12 AM
mms mms is offline
Ultimate Contributor
 
Join Date: Jul 2002
Location: Hamilton, Ontario
Posts: 1,859
Default

Did some poking around in Word - the user can apply kerning to selected text via an option button should he choose.
This feature is not available in Excel however.

So what I get from this, is that all true type fonts include a kerning pairs table,
however it is up to the individual app to decide whether or not to apply kerning, and if so,
write the necessary code to implement it.
Reply With Quote
  #11  
Old 02-14-2017, 10:30 PM
Cerian Knight's Avatar
Cerian KnightFont Kerning Cerian Knight is offline
Polymath (in disciplina)

Super Moderator
* Expert *
 
Join Date: May 2004
Location: Michigan
Posts: 4,193
Default

Quote:
Originally Posted by mms View Post
...write the necessary code to implement it.
Regardless of whether you read C code, the comments here outline the process well enough:
http://www.codeguru.com/cpp/w-p/prin...ext-Output.htm
__________________
I got all the answers wrong on the GLAT, apparently even #9 (where I put a period in the middle of the box and labeled it 'singularity ripe for rapid inflation').
Reply With Quote
  #12  
Old 02-15-2017, 06:52 AM
mms mms is offline
Ultimate Contributor
 
Join Date: Jul 2002
Location: Hamilton, Ontario
Posts: 1,859
Default

Thank you for the code link!

It looks like it is all there.
Reply With Quote
Reply

Tags
kerning, output, tested, text, object, print, forms, form, setting, missing, methods, method, api, label1.caption, label, kerned, gdi, noticed, gdi+, outputting, program, functions, set, caption, intrinsic


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Font Kerning
Font Kerning
Font Kerning Font Kerning
Font Kerning
Font Kerning
Font Kerning Font Kerning Font Kerning Font Kerning Font Kerning Font Kerning Font Kerning
Font Kerning
Font Kerning
 
Font Kerning
Font Kerning
 
-->