Results 1 to 3 of 3

Thread: EMERGENCY, fonts at angles!!!

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089

    Exclamation

    Sorry to get you guys to do my work for me, but this is a bit of a chrisis.

    Basicly I'm going away for christmas in a couple of hours and the guys I'm working for have just emailed me asking me to change some code. I'm sending back some pointers on how to do It as I really don't have time, but I need to explain how to change the angle of the font using the API.

    I can't test this lot or anything but I'm pretty sure the API's you need are these

    Code:
    Private Type LOGFONT
            lfHeight As Long
            lfWidth As Long
            lfEscapement As Long
            lfOrientation As Long
            lfWeight As Long
            lfItalic As Byte
            lfUnderline As Byte
            lfStrikeOut As Byte
            lfCharSet As Byte
            lfOutPrecision As Byte
            lfClipPrecision As Byte
            lfQuality As Byte
            lfPitchAndFamily As Byte
            lfFaceName(1 To LF_FACESIZE) As Byte
    End Type
    
    
    Private Declare Function GetObject Lib "gdi32" Alias "GetObjectA" (ByVal hObject As Long, ByVal nCount As Long, lpObject As Any) As Long
    Private Declare Function SelectObject Lib "gdi32" Alias "SelectObject" (ByVal hdc As Long, ByVal hObject As Long) As Long
    Private Declare Function CreateFontIndirect Lib "gdi32" Alias "CreateFontIndirectA" (lpLogFont As LOGFONT) As Long
    Private Declare Function DeleteObject Lib "gdi32" Alias "DeleteObject" (ByVal hObject As Long) As Long

    use select object to get the handle of the font in a DC, then getobject to fill a LOGFONT with the font data, then change the Escapement and orientation to the angle you want the font at ( in 1/10ths of degrees measured anti-clockwise from the +ve x axis

    then use createfont indirect and deleteobject selectobject to put the New font in the DC.



    I'm sorry to have to ask so much, but this is really important and very bad Timing, I'm not sure how much API experience they have, I think it's very little.

    If anyone could help I'd be so greatful.

    Thanks.
    If it wasn't for this sentence I wouldn't have a signature at all.

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Back shortly...
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  3. #3
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Okay - these should help:

    http://www.vbaccelerator.com/codelib...o/sidelogo.htm
    http://www.katisha.demon.co.uk/vb/ti...ngle_text.html

    Forgot I had that last one (strange considering I wrote it!)
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width