The width of a given string place on a canvas in a specified font seems
to match the value returned by [font measure]. In my specific case,
that value is 60.
However, if I rotate the text by 90 degrees so that the string is
vertical (using 8.6 code), the string now takes up about 70 pixels in
height. I need to adjust the rotated string so that it's only 60 pixels
high.
So, it would seem that I need to know some sort of ratio value in order
to modify the font associated with my vertical strings. So, what things
play into that value (non-square pixels?, screen aspect ratio?, etc) and
how do I get to them?
Thanks,
Jeff
|
|
0
|
|
|
|
Reply
|
Jeff
|
4/28/2010 3:53:46 PM |
|
Jeff Godfrey wrote:
> So, it would seem that I need to know some sort of ratio value in order
> to modify the font associated with my vertical strings. So, what things
> play into that value (non-square pixels?, screen aspect ratio?, etc) and
> how do I get to them?
Hmmm... Upon further investigation, something seems wrong here. When
the text is rotated 90 degrees, it's noticeably larger (in width and
height). I'd guess that's not expected, is it?
FWIW, I'm using an AS build - 8.6b1.1 on Win7 x64.
Jeff
|
|
0
|
|
|
|
Reply
|
Jeff
|
4/28/2010 4:14:11 PM
|
|
Jeff Godfrey wrote:
> Hmmm... Upon further investigation, something seems wrong here.
Bug report filed as SF with additional details (ref # 2993702)
Jeff
|
|
0
|
|
|
|
Reply
|
Jeff
|
4/28/2010 4:54:30 PM
|
|
On 28 Apr, 17:14, Jeff Godfrey <jeff_godf...@pobox.com> wrote:
> Hmmm... Upon further investigation, something seems wrong here. =A0When
> the text is rotated 90 degrees, it's noticeably larger (in width and
> height). =A0I'd guess that's not expected, is it?
As far as I'm aware, we just ask for an angled font of a particular
size and leave Windows to do the rest. Have you tried doing an angle
of 0.01 in comparison with zero-angle text? That does angled lettering
(exercising the same code as the 90 degree case) but does not *appear*
to be rotated at the sizes you're working with. It's a technique I
used when debugging the X11 and OSX rotated font code...
(I don't have a system suitably comparable for testing.)
Donal.
|
|
0
|
|
|
|
Reply
|
Donal
|
4/28/2010 10:38:06 PM
|
|
Donal K. Fellows wrote:
> Have you tried doing an angle
> of 0.01 in comparison with zero-angle text? That does angled lettering
> (exercising the same code as the 90 degree case) but does not *appear*
> to be rotated at the sizes you're working with. It's a technique I
> used when debugging the X11 and OSX rotated font code...
Donal,
Great suggestion - thanks. Yes, rotating the string to 0.01 does
exhibit the originally reported problem. That is, the text grows in
exactly the same way (and in the same amount) as the 90 degree rotation.
The originally reported clipping issues are evident in this case also.
Jeff
|
|
0
|
|
|
|
Reply
|
Jeff
|
4/28/2010 11:13:53 PM
|
|
On 29 Apr, 00:13, Jeff Godfrey <jeff_godf...@pobox.com> wrote:
> Great suggestion - thanks. =A0Yes, rotating the string to 0.01 does
> exhibit the originally reported problem. =A0That is, the text grows in
> exactly the same way (and in the same amount) as the 90 degree rotation.
OK, so it's getting the font size wrong when applying the rotation.
*bad*word* :-(
> The originally reported clipping issues are evident in this case
> also.
That's expected given what you reported above. Tk calculates the
metrics unrotated and then rotates them (it's easier than calculating
metrics directly with rotated fonts).
Donal.
|
|
0
|
|
|
|
Reply
|
Donal
|
4/29/2010 7:48:51 AM
|
|
On Apr 29, 9:48=A0am, "Donal K. Fellows"
<donal.k.fell...@manchester.ac.uk> wrote:
>
> That's expected given what you reported above. Tk calculates the
> metrics unrotated and then rotates them (it's easier than calculating
> metrics directly with rotated fonts).
Then could it be that the rotated font has a different point-size-to-
actual-size ratio than the original ? At 45 degrees, the bounding box
of a given square character is sqrt(2) times larger than the original,
so you need a bitmap that much larger...
-Alex
|
|
0
|
|
|
|
Reply
|
Alexandre
|
4/29/2010 8:48:27 AM
|
|
On 29 Apr, 09:48, Alexandre Ferrieux <alexandre.ferri...@gmail.com>
wrote:
> Then could it be that the rotated font has a different point-size-to-
> actual-size ratio than the original ?
If that's the case, then either we're asking for the wrong thing
somewhere, or there's a bug in Windows's font system, or there's a bug
in the Consolas font itself. I can't really pursue this though; I've
no Win7 system and back when I wrote the code it appeared to work when
I was spinning text in WinXP. (I have no idea whether I tested with
the Consolas font.)
Donal.
|
|
0
|
|
|
|
Reply
|
Donal
|
4/29/2010 10:47:45 AM
|
|
On Apr 29, 12:47=A0pm, "Donal K. Fellows"
<donal.k.fell...@manchester.ac.uk> wrote:
> On 29 Apr, 09:48, Alexandre Ferrieux <alexandre.ferri...@gmail.com>
> wrote:
>
> > Then could it be that the rotated font has a different point-size-to-
> > actual-size ratio than the original ?
>
> If that's the case, then either we're asking for the wrong thing
> somewhere, or there's a bug in Windows's font system, or there's a bug
> in the Consolas font itself.
Yes, but waiting for Windows to fix itself is not in our roadmap,
right ?
On the workaround side, can you explain why "it's easier than
calculating metrics directly with rotated fonts" ? Is it hard to call
GetTextMetrics() on the rotated font ?
-Alex
|
|
0
|
|
|
|
Reply
|
Alexandre
|
4/29/2010 12:26:07 PM
|
|
On 4/29/2010 5:47 AM, Donal K. Fellows wrote:
> On 29 Apr, 09:48, Alexandre Ferrieux<alexandre.ferri...@gmail.com>
> wrote:
>> Then could it be that the rotated font has a different point-size-to-
>> actual-size ratio than the original ?
>
> If that's the case, then either we're asking for the wrong thing
> somewhere, or there's a bug in Windows's font system, or there's a bug
> in the Consolas font itself. I can't really pursue this though; I've
> no Win7 system and back when I wrote the code it appeared to work when
> I was spinning text in WinXP. (I have no idea whether I tested with
> the Consolas font.)
I haven't tried anything but the Consolas font. I'll check out some
other fonts today and report back. Also, I haven't tried this under XP
as I don't have an 8.6 installation on an XP box. I'll remedy that
today and give it a try.
Jeff
|
|
0
|
|
|
|
Reply
|
Jeff
|
4/29/2010 12:29:42 PM
|
|
On 4/29/2010 7:29 AM, Jeff Godfrey wrote:
> On 4/29/2010 5:47 AM, Donal K. Fellows wrote:
>> On 29 Apr, 09:48, Alexandre Ferrieux<alexandre.ferri...@gmail.com>
>> wrote:
>>> Then could it be that the rotated font has a different point-size-to-
>>> actual-size ratio than the original ?
>>
>> If that's the case, then either we're asking for the wrong thing
>> somewhere, or there's a bug in Windows's font system, or there's a bug
>> in the Consolas font itself. I can't really pursue this though; I've
>> no Win7 system and back when I wrote the code it appeared to work when
>> I was spinning text in WinXP. (I have no idea whether I tested with
>> the Consolas font.)
>
> I haven't tried anything but the Consolas font. I'll check out some
> other fonts today and report back. Also, I haven't tried this under XP
> as I don't have an 8.6 installation on an XP box. I'll remedy that today
> and give it a try.
>
> Jeff
OK,
I just installed 8.6b1.1 on an XP box. Testing there shows that it's
not a Win 7 problem - XP shows exactly the same issues. However,
testing with different fonts provide some interesting info...
At first blush, it appears to be a problem only when using monospaced
fonts (Consolas, Courier, etc). So far, every monospaced font I've
tested shows the problem. In addition, the typical Windows proportional
fonts (Tahoma, Verdana, etc) seem to be OK.
I'll update the ticket with this info sometime this morning.
Jeff
|
|
0
|
|
|
|
Reply
|
Jeff
|
4/29/2010 1:20:19 PM
|
|
|
10 Replies
370 Views
(page loaded in 0.122 seconds)
Similiar Articles: canvas, [font measure], and vertical text - comp.lang.tcl ...The width of a given string place on a canvas in a specified font seems to match the value returned by [font measure]. In my specific case, that ... how can i get the text of entry in TK? - comp.lang.rubycanvas, [font measure], and vertical text - comp.lang.tcl ... how can i get the text of entry in TK? - comp.lang.ruby canvas, [font measure], and vertical text - comp.lang ... Euro symbol canvas postscript - comp.lang.perl.tkcanvas, [font measure], and vertical text - comp.lang.tcl ... Filling in the space between two parallel lines with a color ..... looked at patch but when I wanted to color ... Aspect Ratio - comp.graphics.api.openglcanvas, [font measure], and vertical text - comp.lang.tcl ... So, what things > play into that value (non-square pixels?, screen aspect ratio?, etc) and > how do I get to ... J2ME scrolling canvas? - comp.lang.java.gui16x16 bitmap font - comp.fonts J2ME & Eclipse - comp.lang.java ... J2ME - How to Vertical scroll text using Canvas (Java Micro ... Hello, I am using Canvas in my ... Sampling: What Nyquist Didn't Say, and What to Do About It - comp ...What you want to measure, though, is the ... using wider margins and a larger font. I think there is some magic ratio of text ... point of that - by reducing the vertical ... top 10 uses for random data compression?? anyone? - comp ...Her major was vertical, mobile, and requests in front of ... Plenty of constant literary text balances chemicals ... variable ceiling, whilst Haji inadvertently measures them ... canvas, [font measure], and vertical text - comp.lang.tcl ...The width of a given string place on a canvas in a specified font seems to match the value returned by [font measure]. In my specific case, that ... Font metrics and vertical space in CSS « The Typekit BlogFF Meta Web Pro on an infinite canvas. Some of the most interesting, critical font math for web ... when two typefaces are combined on the same line of text, vertical ... 7/21/2012 11:03:39 PM
|