Default math font size?

Discuss the formula editor

Default math font size?

Postby Frie25 » Tue Mar 12, 2019 11:36 am

Can i a specify the default math font size?If yes then will be grateful if someone explains me how.Genuine replies are appreciated. :D
[url=https://www.dqfansurvey.us/]dqfansurvey[/url]
User avatar
Frie25
Banned
 
Posts: 2
Joined: Tue Mar 12, 2019 11:30 am

Re: Default math font size?

Postby Lupp » Tue Mar 12, 2019 12:24 pm

Menu path >Format>Font Size...
Genuine enough?
On Windows 10: LibreOffice 6.2 and older versions, PortableOpenOffice 4.1.5 and older, StarOffice 5.2
---
Lupp from München
User avatar
Lupp
Volunteer
 
Posts: 2402
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Default math font size?

Postby Lupp » Wed Mar 13, 2019 2:19 pm

Assuming your answer was "no" because you wanted to set the .BaseFontHeight to a different value for all your newly created OLE objects containing a Math component, I took the opportunity to ask the generalised fundamental question concerning the topic in a different forum where I expeced a specific developer to expose his knowledge - and he did.
See https://ask.libreoffice.org/en/question ... ts-stored/.

Because the question was of some general interest for me (though not needing an answer since I mostly use some collecions of formulas as template surrogates) I also wrote a little macro usable to insert a formula into a Writer document setting the respective property at the same time. In fact I wouldn't recommend it for actual use in the current state because no precautions concerning the vertical alignment are taken so far. If interested you may study the code below. (Only tested with LibO V 6.2 and with AOO V 4.1.5)
Code: Select all   Expand viewCollapse view
Sub insertFormulaSettingBaseFontHeight(Optional pBFH As Long)
REM You may also want to adjust the position. More insight needed.
REM You can simplify the the parameter handling for use in LibO.
If IsMissing(pBFH) Then
  bfh = 8 REM For testing!
Else
  bfh = pBFH
End If
doc0              = ThisComponent
doc0Frame         = doc0.CurrentController.Frame
dispatchHelper    = createUnoService("com.sun.star.frame.DispatchHelper")
dispatchHelper.executeDispatch(doc0Frame, ".uno:InsertObjectStarMath", "", 0, Array())
eos               = doc0.EmbeddedObjects
u                 = eos.Count - 1
eo                = eos.getByName(eos.ElementNames(u))
fo                = eo.Model
fo.BaseFontHeight = bfh
doc0Frame.activate
End Sub
On Windows 10: LibreOffice 6.2 and older versions, PortableOpenOffice 4.1.5 and older, StarOffice 5.2
---
Lupp from München
User avatar
Lupp
Volunteer
 
Posts: 2402
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany


Return to Math

Who is online

Users browsing this forum: No registered users and 0 guests