Skip to main content

News

Topic: ZeC: Fonts (Read 271 times) previous topic - next topic

ZeC: Fonts
I have a lengthy message in ZeC that I am trying to keep within the borders of the message box. As you can see from the screencaps only 1 font comes close without having to resize the box. Might anyone know of some other fonts that might function as intended?
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • miniSphere Developer
Re: ZeC: Fonts
Reply #1
If you're trying to fit text within the bounds of a box and you know the size of the box, then the Sphere v1 API has two functions for that purpose:

Font#wordWrapString() word-wraps text in advance and gives you an array of strings you can draw line-by-line later:
https://github.com/sphere-group/sphere/blob/master/sphere/docs/development/api.txt#L1526-L1528

Font#drawTextBox() does the word-wrapping and rendering in one step:
https://github.com/sphere-group/sphere/blob/master/sphere/docs/development/api.txt#L1514-L1525

Then you can use any font you want. 8)
miniSphere 5.0.1 - Cell compiler - SSj debugger - thread | on GitHub
For the sake of our continued health I very much hope that Fat Cerberus does not become skilled enough at whatever arcane art it would require to cause computers to spawn enourmous man eating pigs ~Rhuan

Re: ZeC: Fonts
Reply #2

Font#drawTextBox() does the word-wrapping and rendering in one step:
https://github.com/sphere-group/sphere/blob/master/sphere/docs/development/api.txt#L1514-L1525

Then you can use any font you want. 8)

The boxes are being drawn with Font#drawTextBox already or I should say the text is. Refering to screencaps 3, 4, 5. The first is a copy of the font from final fantasy 2 or 3. The second was the original font I was using and the 3rd is the default system font from sphere.
  • Last Edit: August 19, 2017, 11:51:45 pm by Miscreant
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

Re: ZeC: Fonts
Reply #3
I went through the downloads repository and downloaded a buch of different things trying to find fonts i could use. I also imported over 50 windows fonts of varying sizes. The only font I have found so far is one that (I think it was @DaVince ) is called s_capt.rfn. I'm still trying to find a font though.

Below is a screencap of the s_capt font in use.

Until I find a font that goes well with the rest of ZeC, may I use the s_capt font?
  • Last Edit: August 20, 2017, 02:38:17 am by Miscreant
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

Re: ZeC: Fonts
Reply #4
Quick note: Looking at the author info from the sphere project with s_capt.rfn, it is listed as NeoLogiX not DaVince.
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

  • DaVince
  • [*][*][*][*][*]
  • Administrator
  • Used Sphere for, like, half my life
Re: ZeC: Fonts
Reply #5
Anything in the downloads repository is exactly there to be used, and I'm sure N E O would be more than flattered if you did. :)

Don't forget, you could always try importing a ttf-based pixel font too! The original editor has a Windows font to Sphere font converter and I believe miniSphere may even support TTF natively.

Re: ZeC: Fonts
Reply #6
I also imported over 50 windows fonts of varying sizes.
"I am to misbehave." - Malcom Renyolds, Captain of Serenity