[Solved] Letter variation by font variation

Discussions about using 3rd party extension with OpenOffice.org

[Solved] Letter variation by font variation

Postby T-low » Sun Mar 05, 2017 10:42 pm

Hi, I was looking for a font or font tool that has letter variation to imitate handwriting.
I only found normal font tools, font tools with minimal variation or super expensive font tools with medium variation.
I am ''aware (limit to characters?)'' of the problem with implementing variation to a font template in open office.
So how to solve this? A font with variation in letters for handwriting in open office and on top of that cheap or better free?

I thought of a Extension where you can add x many fonts for the variation in letters and the extension would change every letter through the given fonts. (simpler)
Or to let the extension read the letters in an array and variate the font from that... (more complicated)
So for example you feed the extension with only 5 fonts in the simple version, you would become a way better variation of letters than some of the most expensive variating fonts.
I have not much programming experience so I would like some advice if this Idea is in any way possible?

Sorry for grammar and spelling :(

Thx for every comment in advance ;)
Last edited by T-low on Mon Mar 06, 2017 12:49 pm, edited 1 time in total.
OpenOffice 4.1.2 on Windows 10
Posts: 2
Joined: Sun Mar 05, 2017 9:59 pm

Re: Letter variation by font variation

Postby RoryOF » Sun Mar 05, 2017 10:53 pm

There is discussion on methods in this posting

It would need a lot of programming skill (and time), which I doubt you or we have.
Apache OpenOffice 4.1.6 on Xubuntu 18.04.2 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
Posts: 28784
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Letter variation by font variation

Postby JeJe » Sun Mar 05, 2017 11:26 pm

Code: Select all   Expand viewCollapse view
   Option Explicit
   Global oDocView
   Global oKeyHandler
   sub InitialiseMacros
   end sub
   Sub RegisterKeyHandler
      oDocView = ThisComponent.getCurrentController
      oKeyHandler = createUnoListener("MyApp_", "com.sun.star.awt.XKeyHandler")
   End Sub
   Sub UnregisterKeyHandler
   End Sub
   Sub MyApp_disposing(oEvt)
   End Sub
   Function MyApp_KeyReleased(oEvt) As Boolean
   end function
   Function MyApp_KeyPressed(oEvt as object) As Boolean
   dim ff,v As Integer, oVC
   ff = array("Times New Roman","Courier New","Modern","Papyrus")
   if oEvt.keychar<>0 then
   v= CInt(Int((ubound(ff) * Rnd()) + 1))
   oVC = thisComponent.getCurrentController.getViewCursor
   oVC.charfontname = ff(v)
   end if
   end function

if you put this in a module and press f5 to run InitialiseMacros. It will pick a random font name for each letter pressed.
Openoffice 4.1.2
Windows 8
Posts: 482
Joined: Wed Mar 09, 2016 2:40 pm

Re: Letter variation by font variation

Postby T-low » Mon Mar 06, 2017 12:47 pm

@RoryOF thanks for the link :)
Shows nicely the limitations to fonts.

@JeJe awesome Macro :D
It is exactly the solution to my "simple method thought" for randomly selecting fonts.
Now i just have to set up 10 nice fonts to switch through randomly ^^
I try to post some results here and try to write an macro for a letter array randomness o_o

thx for the awesome replies :)
OpenOffice 4.1.2 on Windows 10
Posts: 2
Joined: Sun Mar 05, 2017 9:59 pm

Return to Extensions

Who is online

Users browsing this forum: No registered users and 2 guests