Full justification code?

Just starting out? Need help? Post your questions and find answers here.
Joubarbe
Enthusiast
Enthusiast
Posts: 714
Joined: Wed Sep 18, 2013 11:54 am
Location: France

Full justification code?

Post by Joubarbe »

Does anyone have a full justify function for mono fonts? I'm sure that must exist somewhere :)
firace
Addict
Addict
Posts: 947
Joined: Wed Nov 09, 2011 8:58 am

Re: Full justification code?

Post by firace »

Joubarbe wrote: Tue Feb 13, 2024 1:44 pm Does anyone have a full justify function for mono fonts? I'm sure that must exist somewhere :)
For the EditorGadget?
And do you need cross platform?
Joubarbe
Enthusiast
Enthusiast
Posts: 714
Joined: Wed Sep 18, 2013 11:54 am
Location: France

Re: Full justification code?

Post by Joubarbe »

General purpose. It would be for my own gadget, so nothing to do with the native ones. There are some codes out there for other languages, including Python and Java, but I failed at porting them :?
#NULL
Addict
Addict
Posts: 1499
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Re: Full justification code?

Post by #NULL »

I did something like general text justification (with any font) in sgx. IIRC you it could justify text by expanding the spaces between the words or even between the characters (not sure what the latter was exactly).
Use 'Find in files' with sgx.pbi to find all places, mostly sgx_drawTextLF() (needs one other function and an enumeration)
examples for how it looks are in sgxDoc/04sgxText.pb

But maybe you are looking for something more specific where words/characters stay within the monospace 'matrix' and don't get shifted pixelwise? I don't have anything for that right now.
Joubarbe
Enthusiast
Enthusiast
Posts: 714
Joined: Wed Sep 18, 2013 11:54 am
Location: France

Re: Full justification code?

Post by Joubarbe »

Ok thanks for the help #NULL.
Post Reply