Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
True foxels to pixels
Message
 
To
15/01/2014 04:53:53
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01591898
Message ID:
01592041
Views:
162
>Does anyone know of a true algorithm which mimics VFP's foxels to pixels conversion?
Try
http://www.berezniker.com/content/pages/visual-foxpro/pixels-and-foxels

>
>I found this algorithm online and modified it somewhat to adjust for the font attributes bold, underline, and italics. It ranges in accuracy (depending on the font and attributes) from being perfect, to being within a few pixels of being accurate.
>
>I can't figure out what VFP is doing to convert foxels to pixels as it does. Does anyone know?
>
>
**********
>* Converts VFP foxels to screen pixels
>* tnFoxels        - fractional foxel value to convert
>* tlVertical      - Is this a Y coordinate?
>* tcFontName      - "Arial" for example
>* tnFontSize      - 10
>* tlFontBold      - Is the font bold?
>* tlFontItalics   - Is the font in italics?
>* tlFontUnderline - Is the font underlined?
>*****
>FUNCTION foxels_to_pixels
>LPARAMETERS tnFoxels, tlVertical, tcFontName, tnFontSize, tlFontBold, tlFontItalics, tlFontUnderline
>LOCAL lcStyle
>    **********
>    * Note:     B Bold
>    *           I Italic
>    *           N Normal
>    *           O Outline
>    *           Q Opaque
>    *           S Shadow
>    *           – Strikeout
>    *           T Transparent
>    *           U Underline
>    *****
>    lcStyle = IIF(tlFontBold, "B", "") + IIF(tlFontItalics, "I", "") + IIF(tlFontUnderline, "U", "")
>    IF PCOUNT() > 2
>        RETURN tnFoxels * FONTMETRIC(IIF(tlVertical, 1, 6), tcFontName, tnFontSize, lcStyle)
>    ELSE
>        RETURN tnFoxels * FONTMETRIC(IIF(tlVertical, 1, 6))
>    ENDIF   
>
_______________________________________________________________
Testing displays the presence, not the absence of bugs.
If a software application has to be designed, it has to be designed correctly!
_______________________________________________________________
Vladimir Zografski
Systems Analyst
Previous
Reply
Map
View

Click here to load this message in the networking platform