jtran007
asked on
c# get the width of char with given font
Hi,
How do I get the width of char with given font?
Thanks,
JT
How do I get the width of char with given font?
Thanks,
JT
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Thanks,
JT
JT
Note that MeasureString adds aditional space.
But MeasureCharacterRanges is complex to use. It returns a Region for each CharacterRange and you need dispose it.
Dim cr2Xact(1) As CharacterRange
Dim sf_xact As New StringFormat(StringFormat.
cr2Xact(0).Length = l1
cr2Xact(1).First = p2
cr2Xact(1).Length = l2
sf_xact.SetMeasurableChara
Dim rgn = ig.MeasureCharacterRanges(
x3 = x0 + CInt(rgn(0).GetBounds(ig).
x4 = x0 + CInt(rgn(1).GetBounds(ig).
rgn(0).Dispose() : rgn(1).Dispose()