default font
default font
How to set default font?
story:
i wrote (2) test app (irc server and client)
compiled client in ubuntu 10.10 width demo 4.5
it works but fonts are bigger than in win
another question... visual designer in linux how? any link?
story:
i wrote (2) test app (irc server and client)
compiled client in ubuntu 10.10 width demo 4.5
it works but fonts are bigger than in win
another question... visual designer in linux how? any link?
Registered user of PB (on Linux Mint 21.1 & Win 10 64bit)
Re: default font
for gadgets:
it's in the manual.
for 2d drawing i don't know.
Code: Select all
SetGadgetFont(#PB_Default, FontID)
for 2d drawing i don't know.
Re: default font
but doesn't that depend on the local OS / user settings or monitor resolutions ?sartic wrote:it works but fonts are bigger than in win
how to what ?sartic wrote:visual designer in linux how?
Two growing code-collections: WinApi-Lib by RSBasic ~ LinuxAPI-Lib by Omi
Missing a download-file on the forums? ~ check out this backup page.
Missing a download-file on the forums? ~ check out this backup page.
Re: default font
or better where is it ?Vera wrote:but doesn't that depend on the local OS / user settings or monitor resolutions ?sartic wrote:it works but fonts are bigger than in win
how to what ?sartic wrote:visual designer in linux how?
is there a designer in linux demo?
Registered user of PB (on Linux Mint 21.1 & Win 10 64bit)
Re: default font
ok, i will try both.
same app (win exe) under wine have no big problems.
same app (win exe) under wine have no big problems.
Registered user of PB (on Linux Mint 21.1 & Win 10 64bit)
Re: default font
No - the Visual Designer for Linux is not part of any distribution but you can find all you need here: Visual Designer V4 Alpha 16 Windows and Linux Releasedsartic wrote: or better where is it ?
is there a designer in linux demo?
and this might be of interest too: Does Visual Designer actually work in Linux?
and for more infos you may also use this SEARCH feature
good luck ~ Vera
Two growing code-collections: WinApi-Lib by RSBasic ~ LinuxAPI-Lib by Omi
Missing a download-file on the forums? ~ check out this backup page.
Missing a download-file on the forums? ~ check out this backup page.
Re: default font
How to know the name of the default font Gadget?
Linux Mint Maya(Mate), x86, PureBasic 5.00(5.10b1)
Re: default font
A gadget's current font name and font's size can be obtained with the following code:lakomet wrote:How to know the name of the default font Gadget?
Code: Select all
EnableExplicit
ImportC ""
pango_context_get_font_description(*PangoContext)
pango_font_description_to_string(*PangoFontDescription)
EndImport
Procedure GetGadgetFontInfos(GadgetID.I)
Protected *FontDescription
Protected PangoContext.I
Protected PangoFontDescription.I
PangoContext = gtk_widget_get_pango_context_(GadgetID(GadgetID))
If PangoContext
PangoFontDescription = pango_context_get_font_description(PangoContext)
If PangoFontDescription
*FontDescription = pango_font_description_to_string(PangoFontDescription)
If *FontDescription
MessageRequester("Info", PeekS(*FontDescription))
EndIf
EndIf
EndIf
EndProcedure
OpenWindow(0, 270, 100, 170, 45, "Font infos")
ButtonGadget(0, 10, 10, WindowWidth(0) - 20, 25, "Get font infos")
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Break
Case #PB_Event_Gadget
If EventGadget() = 0 And EventType() = #PB_EventType_LeftClick
GetGadgetFontInfos(0)
EndIf
EndSelect
ForEver
Re: default font
Does work on Ubuntu, thank you :3
Just a small correction so it work in unicode compilation mode:
Just a small correction so it work in unicode compilation mode:
Code: Select all
EnableExplicit
ImportC ""
pango_context_get_font_description(*PangoContext)
pango_font_description_to_string(*PangoFontDescription)
EndImport
Procedure GetGadgetFontInfos(GadgetID.I)
Protected *FontDescription
Protected PangoContext.I
Protected PangoFontDescription.I
PangoContext = gtk_widget_get_pango_context_(GadgetID(GadgetID))
If PangoContext
PangoFontDescription = pango_context_get_font_description(PangoContext)
If PangoFontDescription
*FontDescription = pango_font_description_to_string(PangoFontDescription)
If *FontDescription
MessageRequester("Info", PeekS(*FontDescription,MemorySize(*FontDescription),#PB_Ascii))
EndIf
EndIf
EndIf
EndProcedure
OpenWindow(0, 270, 100, 170, 45, "Font infos")
ButtonGadget(0, 10, 10, WindowWidth(0) - 20, 25, "Get font infos")
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Break
Case #PB_Event_Gadget
If EventGadget() = 0 And EventType() = #PB_EventType_LeftClick
GetGadgetFontInfos(0)
EndIf
EndSelect
ForEver
-
- Enthusiast
- Posts: 468
- Joined: Sat Dec 20, 2003 6:19 pm
- Location: Switzerland
Re: default font
You should call g_free_() on the *FontDescription memory.
See: http://developer.gnome.org/pango/stable ... -to-string
Also MemorySize() is wrong. Use -1 and hope Pango does
return correct strings. (Btw, it may be possible that the string
is UTF8, but I don't know anything about font families..)
See: http://developer.gnome.org/pango/stable ... -to-string
Also MemorySize() is wrong. Use -1 and hope Pango does
return correct strings. (Btw, it may be possible that the string
is UTF8, but I don't know anything about font families..)
Athlon64 3700+, 1024MB Ram, Radeon X1600
Re: default font
Thank you Poshu for pointing out that the flag #PB_Ascii has to be added for compilation in Unicode mode and
thank you Remi for pointing out that the *FontDescription string has to be freed. I totally overlooked that...
I have updated my first code example:
thank you Remi for pointing out that the *FontDescription string has to be freed. I totally overlooked that...
I have updated my first code example:
Code: Select all
EnableExplicit
ImportC ""
pango_context_get_font_description(*PangoContext)
pango_font_description_to_string(*PangoFontDescription)
EndImport
Procedure GetGadgetFontInfos(GadgetID.I)
Protected *FontDescription
Protected PangoContext.I
Protected PangoFontDescription.I
PangoContext = gtk_widget_get_pango_context_(GadgetID(GadgetID))
If PangoContext
PangoFontDescription = pango_context_get_font_description(PangoContext)
If PangoFontDescription
*FontDescription = pango_font_description_to_string(PangoFontDescription)
If *FontDescription
MessageRequester("Info", PeekS(*FontDescription, -1, #PB_Ascii))
g_free_(*FontDescription)
EndIf
EndIf
EndIf
EndProcedure
OpenWindow(0, 270, 100, 170, 45, "Font infos")
ButtonGadget(0, 10, 10, WindowWidth(0) - 20, 25, "Get font infos")
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Break
Case #PB_Event_Gadget
If EventGadget() = 0 And EventType() = #PB_EventType_LeftClick
GetGadgetFontInfos(0)
EndIf
EndSelect
ForEver
Re: default font
How to get the name of the font by the font id?