Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Fontsize
Message
From
13/01/1999 10:31:01
 
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00175424
Message ID:
00175450
Views:
25
I don't think so....but changing the size can get tricky because of the difference between scalable and non. For example, with a scalable font you can directly apply a percentage adjustment to FontSize because a scalable font can handle virutally any reasonable value. But non-scalable fonts only come in certain sizes like 6,7,8,9 or so. In that case you'd have to apply the percentage to the FontSize and then to a "best fit" algorithm.

>Yeah... I'm looking at the code, and I don't think it can get negative, since it's a percentage of the height. So it must be hitting some other limit. Does the control that the font is on impose some limit on fontsize?
>
>Thanks,
>
>-Michelle
>
>>Yes, so you either have to trap the scalability with a flag (see source below) or look out for that -1 value in the first element of the AFONT() array.
>>
>>>Turns out arial, which I use, is scalable. So I'm guessing the resize is making a negative font size.
>>>
>>>Thanks,
>>>
>>>-Michelle
>>>
>>>>Michelle ---
>>>>
>>>>Let me expand a bit on my last post:
>>>>
>>>>lScalable = .F.    && Can use *any* size
>>>>nHighSize = 0
>>>>nLowSize  = 0
>>>>lHasFont=AFONT(aSizes,"MS Sans Serif")
>>>>IF lHasFont   && Font Exists
>>>>   IF ALEN(aSizes)=1 AND aSizes[1]=-1
>>>>      lScalable=.T.
>>>>   ELSE
>>>>      nMax=ALEN(aSizes)
>>>>      nHighSize=aSizes[nMax]
>>>>      nLowSize =aSizes[1]
>>>>   ENDIF
>>>>ENDIF
>>>>
>>>>Results are: If lScalable, can use any size, otherwise nHighSize and nLowSize contain the bounds of the font sizes.
>>>>
>>>>
>>>>>Is there a way to find out what is the smallest size for a font? I've been experimenting with resizing, and if I make the form too small, the fontsize goes to an illegal value. I'd like to know what is the lowest allowed so I can put a check for it. I want this to work for every font, though, so unless they all have the same lowest value, I need some way to check based on the font.
>>>>>
>>>>>Thanks,
>>>>>
>>>>>-Michelle
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform