Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combo Dropdown List Display Problems
Message
 
To
28/06/2001 10:34:26
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00524611
Message ID:
00524706
Views:
20
This message has been marked as a message which has helped to the initial question of the thread.
>>It is very difficult, if not impossible, to get portional fonts to align properly when using spaces to set the alignment. It's simply due to the fact that each character has its own specific width. You're far better of, it terms of ease of doing this by using a non-proportional font.
>>
>>Having said that, you might want to look at the FONTMETRIC() and TXTWIDTH() functions to see if there are some calculations you might be able to make to using proportional fonts work.
>
>Hey George,
>
>Cetin had a work-around using the ColumnWidths property, but I was checking out the FontMetric() and TxtWidth() functions to see if there was anyway I could use them with other stuff I have. Seems like they could have been handy for some past reporting issues. Have you used them in your own stuff before? If so, what types of things were you doing?
>
>Renoir

Just thought I'd throw my .02 in...

I use FONTMETRIC() and TXTWIDTH() frequently. Generally, I've found what I really want to know is the width, in pixels, of a text string using the font properties of an object...
FUNCTION PixelWidth
LPARAMETER tcText, toCalling
LOCAL lcStyle

lcStyle = ""
WITH m.toCalling
  IF .FONTBOLD
    lcStyle = m.lcStyle + "B"
  ENDIF
  IF .FONTITALIC
    lcStyle = m.lcStyle + "I"
  ENDIF
  IF .FONTOUTLINE
    lcStyle = m.lcStyle + "O"
  ENDIF
  IF .FONTSHADOW
    lcStyle = m.lcStyle + "S"
  ENDIF
  IF .FONTSTRIKETHRU
    lcStyle = m.lcStyle + "-"
  ENDIF
  IF .FONTUNDERLINE
    lcStyle = m.lcStyle + "U"
  ENDIF
  RETURN TXTWIDTH(m.tcText,.FONTNAME,.FONTSIZE,m.lcStyle) * FONTMETRIC(6,.FONTNAME,.FONTSIZE,m.lcStyle)
ENDWITH
Brien R. Givens

Brampwood Systems
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform