[Done] DrawVectorText() Font invisible!

Found an issue in the documentation ? Please report it here !

Moderator: Documentation Editors

User avatar
Mijikai
Addict
Addict
Posts: 875
Joined: Sun Sep 11, 2016 2:17 pm

[Done] DrawVectorText() Font invisible!

Post by Mijikai »

Only some Fonts are working with DrawVectorText()!

Code (Tested with PB 5.62 & 5.71 / OS: Windows 7):

Code: Select all

EnableExplicit

Procedure.i Demo(Title.s = #Null$,Width.i = 800,Height.i = 600)
  Protected wnd.i
  Protected wnd_flags.i
  Protected wnd_event.i
  Protected wnd_exit.i
  Protected font1.i
  Protected font2.i
  Protected canvas.i
  wnd_flags = #PB_Window_SystemMenu|#PB_Window_ScreenCentered|#PB_Window_MinimizeGadget
  wnd = OpenWindow(#PB_Any,#Null,#Null,Width,Height,Title,wnd_flags) 
  If wnd
    font1 = LoadFont(#PB_Any,"Consolas",10);<- visible
    font2 = LoadFont(#PB_Any,"Terminal",10);<- invsible !!! (its not only Terminal!!!)
    canvas = CanvasGadget(#PB_Any,10,10,300,180)
    If canvas And font1 And font2
      If StartVectorDrawing(CanvasVectorOutput(canvas))
        VectorSourceColor($FF0000FF)
        ;--------------------------
        VectorFont(FontID(font1),20)
        MovePathCursor(10,10)
        DrawVectorText("Font1: HelloWorld")
        ;--------------------------
        VectorFont(FontID(font2),20)
        MovePathCursor(10,40)
        DrawVectorText("Font2: HelloWorld")
        ;--------------------------
        StopVectorDrawing()  
      EndIf
      Repeat
        Repeat
          wnd_event = WindowEvent()
          Select wnd_event
            Case  #PB_Event_CloseWindow
              wnd_exit = #True
          EndSelect
        Until wnd_event = #Null
      Until wnd_exit
    EndIf
    CloseWindow(wnd)
  EndIf
  ProcedureReturn #Null
EndProcedure

Demo(#Null$,320,200)

End
User avatar
Marc56us
Addict
Addict
Posts: 1019
Joined: Sat Feb 08, 2014 3:26 pm
Location: France

Re: [PB 5.62 & 5.71] DrawVectorText() Font invisible!

Post by Marc56us »

Mijikai wrote:Only some Fonts are working with DrawVectorText()!

Code: Select all

    font1 = LoadFont(#PB_Any,"Consolas",10);<- visible
    font2 = LoadFont(#PB_Any,"Terminal",10);<- invsible !!! (its not only Terminal!!!)
It's not in the help, but I think (logically) only vector fonts can be used with VectorDrawing lib ?
Consolas is vector font (TT), but Terminal is a Bitmap font.

:wink:
(English is not my native language, I use an online translator.)
User avatar
mk-soft
Addict
Addict
Posts: 2956
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: [PB 5.62 & 5.71] DrawVectorText() Font invisible!

Post by mk-soft »

Confirmed on Windows

PB v5.71 and v5.72b1
macOS (Catalina) and Linux (Ubuntu) works
My Projects ThreadToGUI / OOP-BaseClass / OOP-BaseClassDispatch / EventDesigner V3
PB v3.30 / v5.70 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace
User avatar
Marc56us
Addict
Addict
Posts: 1019
Joined: Sat Feb 08, 2014 3:26 pm
Location: France

Re: [PB 5.62 & 5.71] DrawVectorText() Font invisible!

Post by Marc56us »

Also confirmed for FixedSys (Bitmap font on Windows, so no display)

Note that if a font is misspelled, then PB still displays the text but with the default font.

:!: So no bug, but a mention in the help would be useful.
:arrow: VectorDrawing can only use Vector font

:wink:
(English is not my native language, I use an online translator.)
User avatar
Mijikai
Addict
Addict
Posts: 875
Joined: Sun Sep 11, 2016 2:17 pm

Re: [PB 5.62 & 5.71] DrawVectorText() Font invisible!

Post by Mijikai »

MS Sans Serif doenst work either...
User avatar
Marc56us
Addict
Addict
Posts: 1019
Joined: Sat Feb 08, 2014 3:26 pm
Location: France

Re: [PB 5.62 & 5.71] DrawVectorText() Font invisible!

Post by Marc56us »

Mijikai wrote:MS Sans Serif doenst work either...
Yes, but in Windows 10 there is 2

MS Sans Serif :arrow: Bitmap (for compatibility)
Microsoft Sans Serif (micross.ttf) :arrow: Vector (OpenType)

https://en.wikipedia.org/wiki/Microsoft_Sans_Serif

:wink:
(English is not my native language, I use an online translator.)
User avatar
Mijikai
Addict
Addict
Posts: 875
Joined: Sun Sep 11, 2016 2:17 pm

Re: [PB 5.62 & 5.71] DrawVectorText() Font invisible!

Post by Mijikai »

Well u an also try this vector font...
-> https://fontsarena.com/proggy-vector-by ... n-grimmer/
User avatar
Marc56us
Addict
Addict
Posts: 1019
Joined: Sat Feb 08, 2014 3:26 pm
Location: France

Re: [PB 5.62 & 5.71] DrawVectorText() Font invisible!

Post by Marc56us »

Mijikai wrote:Well u an also try this vector font...
-> https://fontsarena.com/proggy-vector-by ... n-grimmer/
There are thousands of more or less compatible or buggy fonts on the Net. We're not going to list them all.
I'm content with what comes with Windows and therefore certified.
:)
(English is not my native language, I use an online translator.)
Fred
Administrator
Administrator
Posts: 14210
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: [PB 5.62 & 5.71] DrawVectorText() Font invisible!

Post by Fred »

To add a mention about bitmap font in the doc
MuuSer
User
User
Posts: 14
Joined: Sat Feb 06, 2010 8:24 pm
Location: Estonia

Re: [PB 5.62 & 5.71] DrawVectorText() Font invisible!

Post by MuuSer »

Fred wrote:To add a mention about bitmap font in the doc
For me in Windows 7 99% of Open Type fonts did not work for DrawVectorText. Works only Trye Type fonts.
Post Reply