Announcement

Collapse
No announcement yet.

Fonts relative

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Fonts relative

    Guys --
    Somebody know
    1) how to set charset explicity for OEM font (Lucida Console) ?
    OEM_CHARSET doesn't satisfy me, because depends of PC settings.
    (BTW, I want to display OEM text in GUI window)
    2) how to retrieve real facename after CreateFont ?
    I tried
    hFont= CreateFont(... "Blum-Blum")
    GetObject hFont, SizeOf(lf), ByVal VarPtr(lf)
    Msgbox lf.lfFaceName
    and successful received Blum-Bum.



    ------------------
    E-MAIL: [email protected]

  • #2
    About the name of the TypeFace:
    You can't be sure of the font until it is actually selected into a device context.
    Then you can use the GetTextFace(hDC, BYVAL length_szString, BYVAL VARPTR(szString) ) )
    function to retrieve the typeface name of the font.

    Regards,

    ------------------
    [email protected]
    :) IRC :)

    Comment


    • #3
      1) To correctly create a font Lucida Console simply:
      Local lf As LOGFONT
      Local hFont As Long
      GetObject GetStockObject(%OEM_FIXED_FONT), SizeOf(lf), ByVal VarPtr(lf)
      lf.lfFaceName = "Lucida Console"
      hFont = CreateFontIndirect(lf)

      2) This is a normal behavior of windows:
      From MSDN Library:
      "For example, if you request a font named "Palatino," but no such font
      is available on the system, the font mapper will substitute a font that
      has similar attributes but a different name."

      Window expects to help your application run without error for bad font
      name. So when you call CreateFont(... "Blum-Blum") windows using the other
      parameters find a font similar, but named "Blum-Blum".

      Then your code must be a proof of fire , first it must install the font
      when you setup it and at run-time verify if it exist.

      Steve

      ------------------

      Comment


      • #4
        Ian --
        GetTextFace returned correct result under Win2000. Hope, will be the same under other OSes. Thanks.
        Steve --
        it's not a problem to select Lucida Console as it is, using OEM_CHARSET (or like you suggest).
        Problem is to set charset (similar to ANSI fonts).
        I need exactly RUSSIAN_CHARSET. Meanwhile Lucida Console includes other languages.
        With OEM_CHARSET it will be selected charset, according regional settings, which could be non-Russian.


        ------------------
        E-MAIL: [email protected]

        Comment

        Working...
        X