[Solved] Default Font

Keyboard macros or custom scripts

[Solved] Default Font

Postby hika » Sat Apr 21, 2018 10:30 pm

I have bee trying to find the font specifics used as a default in dialogs. This so I can resize them on resizing a dialog.
If I check the FontDescriptor I get:
    Name =
    Height = 0
    Width = 0
    StyleName =
    Family = 0
    CharSet = 0
    Pitch = 0
    CharacterWidth = 0.0
    Weight = 0.0
    Slant = <Enum instance com.sun.star.awt.FontSlant ('DONTKNOW')>
    Underline = 4
    Strikeout = 3
    Orientation = 0.0
    Kerning = False
    WordLineMode = False
    Type = 0

I also checked the Peer and that gives even less.
If I go to the Editor it says "Default" in the propertylist and shows on opening the FontDialog "Liberation Sans 10".
Which also is the size I see being set in options. In Writer I see a default of "Liberation Serif 12" and probably there are more defaults that possibly a user can have changed. Maybe even through the operating system defaults.

So how and where can I access those defaults?

Hika
Last edited by hika on Tue May 08, 2018 6:17 pm, edited 3 times in total.
openoffice 4.1.2/4.1.4 and libreoffice 5.4.4.2/5.4.5.1 both on Gentoo and on Windows
hika
 
Posts: 28
Joined: Tue Apr 17, 2018 12:53 am

Re: Default Font

Postby Zizi64 » Sun Apr 22, 2018 9:13 am

I have bee trying to find the font specifics used as a default in dialogs.


Do you mean the built-in dialogs (The Open dialog, Save dialog, Print dialog, etc... of the AOO/LO) or some user defined dialogs (created programatically)?
Tibor Kovacs, Hungary; LO4.4.7, LO5.4.7 on Win7x64Prof.
PortableApps, winPenPack: LO3.3.0-LO6.1.0 and AOO4.1.5
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
Zizi64
Volunteer
 
Posts: 6982
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Default Font

Postby JeJe » Sun Apr 22, 2018 9:41 am

My default for dialog and dialog control fonts is Segoe UI... that looks to be operating system dependent so you can get them through the Windows Api (SystemParametersInfo) but don't know about Linux.

The FontDescriptor returns those values unless you've changed them. It doesn't answer your query but you could just set all the values you want to be sure of yourself instead of relying on the default. You need to verify changes - if I set the font name to "blah blah" it will then return that as the new name (but of course not change the font to that non-existent one)
Openoffice 4.1.2
Windows 8
JeJe
 
Posts: 232
Joined: Wed Mar 09, 2016 2:40 pm

Re: Default Font

Postby hika » Sun Apr 22, 2018 11:06 am

Zizi64 wrote:Do you mean the built-in dialogs (The Open dialog, Save dialog, Print dialog, etc... of the AOO/LO) or some user defined dialogs (created programatically)?

Mostly the last, but I guess the first uses the same.
openoffice 4.1.2/4.1.4 and libreoffice 5.4.4.2/5.4.5.1 both on Gentoo and on Windows
hika
 
Posts: 28
Joined: Tue Apr 17, 2018 12:53 am

Re: Default Font

Postby hika » Sun Apr 22, 2018 11:14 am

In the mean time I have found I can just change the height through the model.FontHeight attribute, without knowing or touching any other font details in any of the models, so for now I will assume that that always defaults to 10. In a later stage, when I find where to extract the actual value, I can then replace that.

Hika
openoffice 4.1.2/4.1.4 and libreoffice 5.4.4.2/5.4.5.1 both on Gentoo and on Windows
hika
 
Posts: 28
Joined: Tue Apr 17, 2018 12:53 am

Re: Default Font

Postby hika » Fri Apr 27, 2018 1:44 am

I think I found it. They are supplied by the XStyleSettings interface which seems to be accessible through the 'StyleSettings' property in Windows and Dialogcontrols. However part of those settings like a buttoncolor are dependent on the 'NativeWidgetLook' property in the peer. I have to study it further.

Hika
openoffice 4.1.2/4.1.4 and libreoffice 5.4.4.2/5.4.5.1 both on Gentoo and on Windows
hika
 
Posts: 28
Joined: Tue Apr 17, 2018 12:53 am


Return to OpenOffice Basic, Python, BeanShell, JavaScript

Who is online

Users browsing this forum: No registered users and 5 guests