Font Metrics
Posted: Sat Sep 17, 2011 7:48 am
I determined font metrics with my old code:
GetTextMetrics pic.hdc, text_metrics
internal_leading = text_metrics.tmInternalLeading
total_hgt = text_metrics.tmHeight
text_hgt = total_hgt - internal_leading
text_wid = pic.ScaleX(pic.TextWidth("Text")), pic.ScaleMode, vbPixels)
I cant figure out the font metrics correctly with teechart. My results seem to be wrong:
Private Sub TChart1_AfterDraw(ByVal sender As Object, ByVal g As Steema.TeeChart.Drawing.Graphics3D) Handles TChart1.AfterDraw
text_hgt = g.TextHeight("Text") ' without leading
text_wid = g.TextWidth("Text")
total_hgt = ? 'with leading
End Sub
GetTextMetrics pic.hdc, text_metrics
internal_leading = text_metrics.tmInternalLeading
total_hgt = text_metrics.tmHeight
text_hgt = total_hgt - internal_leading
text_wid = pic.ScaleX(pic.TextWidth("Text")), pic.ScaleMode, vbPixels)
I cant figure out the font metrics correctly with teechart. My results seem to be wrong:
Private Sub TChart1_AfterDraw(ByVal sender As Object, ByVal g As Steema.TeeChart.Drawing.Graphics3D) Handles TChart1.AfterDraw
text_hgt = g.TextHeight("Text") ' without leading
text_wid = g.TextWidth("Text")
total_hgt = ? 'with leading
End Sub