Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Thank You for your continued support and contributions!

+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Theming and Appearance Customization
| | |-+  [App] Rockbox Font Convertor [Windows]
« previous next »
  • Print
Pages: 1 2 [3] 4 5

Author Topic: [App] Rockbox Font Convertor [Windows]  (Read 35692 times)

Offline iwantanimac

  • Member
  • *
  • Posts: 42
  • Rockbox <3er.
    • GSh Blog
Re: [App] Rockbox Font Convertor [Windows]
« Reply #30 on: February 28, 2007, 07:08:08 AM »
Hm... for sheer simplicity i really prefer to have a single user input over drag and drop, but maybe we can have two versions... i don't personally like that way of doing it... but i guess if people want it we can do it.

That being said... hmm...

Maybe it can detect if %1 is an integer - font size, and, if it is, convers with that size, and if not, prompts, waits ten seconds, or accepts the input, and converts... I'm sure it would be possible. We've done something similar before... Let me have a look...

As for the GUI i can make it in VB in about an hour, but it'll be ugly, slow and cumbersome, so i won't. I need something lightweight and preferably integrated like C, C++ or something, and I'm not even sure if ill try.
Logged

Offline bascule

  • Rockbox Expert
  • Member
  • *
  • Posts: 1298
Re: [App] Rockbox Font Convertor [Windows]
« Reply #31 on: February 28, 2007, 07:13:24 AM »
Quote from: iwantanimac on February 28, 2007, 07:08:08 AM
Hm... for sheer simplicity i really prefer to have a single user input over drag and drop,

Oh well, my mistake in assuming you were very keen for drag and drop to work :(

How is command line typing simpler than drag and drop plus:
Enter required font size: _
In order to do what the application is designed for?

The two approaches (command line vs d'n'd) are mutually incompatible in this instance, because with d'n'd the parameters %1, %2 etc. are set to the filepaths of the dropped files. There is no way to pass in a single number as well.
« Last Edit: February 28, 2007, 09:28:45 AM by bascule »
Logged
DataBase fanboy and author of the totally overhauled Rockbox Sync Tool

Offline iwantanimac

  • Member
  • *
  • Posts: 42
  • Rockbox <3er.
    • GSh Blog
Re: [App] Rockbox Font Convertor [Windows]
« Reply #32 on: February 28, 2007, 07:17:19 AM »
but i'm sure there must be a way - this is what i was thinking of:

Quote from: bascule
For my batch file, I used:

Quote
if %2 LEQ a (goto 2-CaseSizeSet) else (goto 2-CaseNoSize)


which returns TRUE if %2 is a numeric value, because all numbers are mathematically less than the alphabetic character 'a'.

We could somehow use that... it'd be complex... but it might just work your way and my way...

As for drag 'n' drop, I was keen for it, but then i decided i liked the ability to set the font size without editing the batch file - and i don't want to have the parogram wait for input - it should be (For me) straight from command to output, but i can appreciate that the new PC/Rockbox/DOS user would prefer to have the drag 'n' drop as well as the font sizing... so a hybrid must be possible.

EDIT: I really wish i had more time for this...
« Last Edit: February 28, 2007, 07:18:52 AM by iwantanimac »
Logged

Offline bascule

  • Rockbox Expert
  • Member
  • *
  • Posts: 1298
Re: [App] Rockbox Font Convertor [Windows]
« Reply #33 on: February 28, 2007, 07:18:43 AM »
OK, I'll leave it with you...
Logged
DataBase fanboy and author of the totally overhauled Rockbox Sync Tool

Offline iwantanimac

  • Member
  • *
  • Posts: 42
  • Rockbox <3er.
    • GSh Blog
Re: [App] Rockbox Font Convertor [Windows]
« Reply #34 on: February 28, 2007, 07:38:32 AM »
Okay here's what i've hacked together in about 5 minutes.. it probably doesn't work, but it's how i'd expect it to work. I've commented on pretty much everything - so if you see something I've done wrong, feel free to correct me - It's based on bascule's latest one and i've added some code to check if a font size is set - na i think i did it wrong - if a font size is set it won't do multiple fonts... if i'm right... oh well il upload anyway so you get an idea of how i'm trying to do this (If it even helps)

THIS IS NOT A RELEASE - It's a very badly coded Beta.

[attachment deleted by admin, too old]
Logged

Offline bascule

  • Rockbox Expert
  • Member
  • *
  • Posts: 1298
Re: [App] Rockbox Font Convertor [Windows]
« Reply #35 on: February 28, 2007, 08:39:57 AM »
If you want to make my pre-drag and drop version work how I think you want it to work (although I'm confused now as to what you do want) all you need to do is this:

stick with the makefont [font size] filename1 [filename2 filename3 ...] syntax

But ensure that all spaced filenames are enclosed in quotes, thus making the whole filename a single parameter (This is what dragging and dropping does automatically, thus easing the interpretation of parameters) and ditch the looping filename construction, as it won't be required.
Do the first check on %1 for numeric value or not as per the existing method.
Loop through the parameters, converting each one individually.

E.g.:
makefont  19 "Lucida Grande.ttf" "Arial Black.ttf" "Square721 BT.ttf"
 Â        {%1}{        %2        }{       %3       }{       %4        }

So, yes, a hybrid is possible, as the above solution would also work for dropped files. All it may need is the addition that if %1 is non-numeric (i.e., dragged and dropped files), then jump to a font input routine.

What you can't have AFAIK is a way of defaulting the font size for command line users who do not enter one (presumably because they want the default), but requesting font size input for drag and droppers who will surely want that option, because they can't access a font size option any other way...
« Last Edit: February 28, 2007, 08:55:30 AM by bascule »
Logged
DataBase fanboy and author of the totally overhauled Rockbox Sync Tool

Offline DanManners

  • Artist
  • Member
  • *
  • Posts: 161
  • Eating Babies Since 1991!
    • Myspace (Add Me!!)
Re: [App] Rockbox Font Convertor [Windows]
« Reply #36 on: February 28, 2007, 03:02:17 PM »
This is the SINGLEMOST useful tool anyone's released in a while, IMO. Thank you SO MUCH.

-Dan
Logged

Offline ryran

  • Member
  • *
  • Posts: 379
    • b19 photography
Re: [App] Rockbox Font Convertor [Windows]
« Reply #37 on: February 28, 2007, 03:24:30 PM »
Personally, I think the way Bascule did it in his last release makes the most sense.
And I second Dan--thank you guys so much.
Logged

Offline bascule

  • Rockbox Expert
  • Member
  • *
  • Posts: 1298
Re: [App] Rockbox Font Convertor [Windows]
« Reply #38 on: February 28, 2007, 05:05:57 PM »
OK, I've caved, given the support from you guys :D

Attached is really my final effort, a hybrid app allowing drag and drop or command line usage. Fully tested and working provided the existing caveats are followed.

It only needed one extra line of code (and a modified integer/string check for the font size); even I couldn't complain about that...

Command Line syntax: makefont [font size] filename1 [filename2 filename3 ...]

Drag and Drop: Drop multiple font files onto the batch file. Enter the required font size when prompted, or [return] to default to 8pt.

Font size is optional in the Command Line, but will be prompted for if missing.
Fonts must be in the same folder as the app for both approaches.
Fonts with spaces in their names must be enclosed in quotes.

Command Line examples:
makefont  19 "Lucida Grande.ttf" "Arial Black.ttf" "Square721 BT.ttf"
makefont 12 "comic bold.ttf" comic.ttf
makefont arial.ttf
makefont arial.ttf "Square721 BT.ttf" lucida.ttf
makefont 14 arial.ttf "Square721 BT.ttf" lucida.ttf
Logged
DataBase fanboy and author of the totally overhauled Rockbox Sync Tool

Offline iwantanimac

  • Member
  • *
  • Posts: 42
  • Rockbox <3er.
    • GSh Blog
Re: [App] Rockbox Font Convertor [Windows]
« Reply #39 on: March 01, 2007, 08:28:31 AM »
It's... almost perfect - only problem is you didn't attach the file!

Seriously, man you rule. I hate not having any time to do this, otherwise i'd have done more...

So if you can post your "Final" version, then ill update the builds, help text and add my "Prettying-up" code to it, and it'll be the final-ish version, unless i think of something else to do with it.

Looking amazing - just upload it!!  :D
Logged

Offline bascule

  • Rockbox Expert
  • Member
  • *
  • Posts: 1298
Re: [App] Rockbox Font Convertor [Windows]
« Reply #40 on: March 01, 2007, 08:42:44 AM »
D'oh. I'm at work ATM, so it'll have to wait another 4-5 hours :(

EDIT:

Here it is, really attached this time...

Remember you'll still have to tidy up the help text and add any other frills/colours etc. that you want to :)

[attachment deleted by admin, too old]
« Last Edit: March 01, 2007, 11:46:13 AM by bascule »
Logged
DataBase fanboy and author of the totally overhauled Rockbox Sync Tool

Offline iwantanimac

  • Member
  • *
  • Posts: 42
  • Rockbox <3er.
    • GSh Blog
Re: [App] Rockbox Font Convertor [Windows]
« Reply #41 on: March 01, 2007, 08:48:17 AM »
D'oh!  have to go to bed, and i got school tomorrow, so you'll have to wait another 18 hours anyway!  ;D

Life's funny, innit. G'night all.  ;)
Logged

Offline MrMEC

  • Member
  • *
  • Posts: 56
Re: [App] Rockbox Font Convertor [Windows]
« Reply #42 on: March 03, 2007, 03:45:12 PM »
Just wanted to say that this is a great little program and it finally makes it possible for me to make my own fonts.  Thank you!  Fantastic job.
Logged

Offline iwantanimac

  • Member
  • *
  • Posts: 42
  • Rockbox <3er.
    • GSh Blog
Re: [App] Rockbox Font Convertor [Windows]
« Reply #43 on: March 03, 2007, 10:20:22 PM »
Thanks bascule. I'll be updating this ASAP.
Logged

Offline delorean90

  • Member
  • *
  • Posts: 104
  • My iriver is dead
    • My Myspace
Re: [App] Rockbox Font Convertor [Windows]
« Reply #44 on: March 04, 2007, 01:54:54 PM »
i keep trying to make the font but i cant fiqure out how to do it  right could you please look this over and tell me what i am doing wrong

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\George W. Zadra>cd \

C:\>cd Documents and Settings\George W. Zadra\Desktop\Font Convertor

C:\Documents and Settings\George W. Zadra\Desktop\Font Convertor>makefont[punchl
able.ttf]
'makefont[punchlable.ttf]' is not recognized as an internal or external command,

operable program or batch file.

C:\Documents and Settings\George W. Zadra\Desktop\Font Convertor>makefont [punch
lable.ttf]


ROCKbox Font Convertor v1.1 (Release)
\----------------------------------------------------------------------------/
   Font Size: [punchlable.ttf]pt   Input File: ""
   Output File: "[punchlable.ttf]-.fnt"
 ----------------------------------------------------------------------------
  Converting TTF/OTF to BDF...
otf2bdf: invalid point size '0pt'.
                                                                         Done.
 ----------------------------------------------------------------------------
  Converting BDF to ROCKbox FNT...
Error opening file: [punchlable.ttf]-.bdf
                                                                         Done.
 ----------------------------------------------------------------------------
  Deleting temporary file(s) ("[punchlable.ttf]-.bdf")...
Could Not Find C:\Documents and Settings\George W. Zadra\Desktop\Font Convertor\
[punchlable.ttf]-.bdf
                                                                         Done.
                                                        Press any key to exit.
 --------------------------------------ROCKbox - Open Source Jukebox Firmware-

C:\Documents and Settings\George W. Zadra\Desktop\Font Convertor>makefont [punch
lable.ttf] [10]


ROCKbox Font Convertor v1.1 (Release)
\----------------------------------------------------------------------------/
   Font Size: [punchlable.ttf]pt   Input File: "[10]"
   Output File: "[punchlable.ttf]-[10].fnt"
 ----------------------------------------------------------------------------
  Converting TTF/OTF to BDF...
otf2bdf: invalid point size '0pt'.
                                                                         Done.
 ----------------------------------------------------------------------------
  Converting BDF to ROCKbox FNT...
Error opening file: [punchlable.ttf]-[10].bdf
                                                                         Done.
 ----------------------------------------------------------------------------
  Deleting temporary file(s) ("[punchlable.ttf]-[10].bdf")...
Could Not Find C:\Documents and Settings\George W. Zadra\Desktop\Font Convertor\
[punchlable.ttf]-[10].bdf
                                                                         Done.
                                                        Press any key to exit.
 --------------------------------------ROCKbox - Open Source Jukebox Firmware-

C:\Documents and Settings\George W. Zadra\Desktop\Font Convertor>C:\Documents an
d Settings\George W. Zadra\Desktop\Font Convertor\punchlabel.TTF"
'C:\Documents' is not recognized as an internal or external command,
operable program or batch file.

C:\Documents and Settings\George W. Zadra\Desktop\Font Convertor>makefont [punch
lable.ttf]


ROCKbox Font Convertor v1.1 (Release)
\----------------------------------------------------------------------------/
   Font Size: [punchlable.ttf]pt   Input File: ""
   Output File: "[punchlable.ttf]-.fnt"
 ----------------------------------------------------------------------------
  Converting TTF/OTF to BDF...
otf2bdf: invalid point size '0pt'.
                                                                         Done.
 ----------------------------------------------------------------------------
  Converting BDF to ROCKbox FNT...
Error opening file: [punchlable.ttf]-.bdf
                                                                         Done.
 ----------------------------------------------------------------------------
  Deleting temporary file(s) ("[punchlable.ttf]-.bdf")...
Could Not Find C:\Documents and Settings\George W. Zadra\Desktop\Font Convertor\
[punchlable.ttf]-.bdf
                                                                         Done.
                                                        Press any key to exit.
 --------------------------------------ROCKbox - Open Source Jukebox Firmware-

C:\Documents and Settings\George W. Zadra\Desktop\Font Convertor>makefont [10]
[punchlable.ttf]


ROCKbox Font Convertor v1.1 (Release)
\----------------------------------------------------------------------------/
   Font Size: [10]pt   Input File: "[punchlable.ttf]"
   Output File: "[10]-[punchlable.ttf].fnt"
 ----------------------------------------------------------------------------
  Converting TTF/OTF to BDF...
otf2bdf: invalid point size '0pt'.
                                                                         Done.
 ----------------------------------------------------------------------------
  Converting BDF to ROCKbox FNT...
Error opening file: [10]-[punchlable.ttf].bdf
                                                                         Done.
 ----------------------------------------------------------------------------
  Deleting temporary file(s) ("[10]-[punchlable.ttf].bdf")...
Could Not Find C:\Documents and Settings\George W. Zadra\Desktop\Font Convertor\
[10]-[punchlable.ttf].bdf
                                                                         Done.
                                                        Press any key to exit.
 --------------------------------------ROCKbox - Open Source Jukebox Firmware-

C:\Documents and Settings\George W. Zadra\Desktop\Font Convertor>makefont [10pt]
 [punchlable.ttf]


ROCKbox Font Convertor v1.1 (Release)
\----------------------------------------------------------------------------/
   Font Size: [10pt]pt   Input File: "[punchlable.ttf]"
   Output File: "[10pt]-[punchlable.ttf].fnt"
 ----------------------------------------------------------------------------
  Converting TTF/OTF to BDF...
otf2bdf: invalid point size '0pt'.
                                                                         Done.
 ----------------------------------------------------------------------------
  Converting BDF to ROCKbox FNT...
Error opening file: [10pt]-[punchlable.ttf].bdf
                                                                         Done.
 ----------------------------------------------------------------------------
  Deleting temporary file(s) ("[10pt]-[punchlable.ttf].bdf")...
Could Not Find C:\Documents and Settings\George W. Zadra\Desktop\Font Convertor\
[10pt]-[punchlable.ttf].bdf
                                                                         Done.
                                                        Press any key to exit.
 --------------------------------------ROCKbox - Open Source Jukebox Firmware-

C:\Documents and Settings\George W. Zadra\Desktop\Font Convertor>
Logged
Proud owner of a sansa view 16gb, fingers crossed for a rockbox port :)

  • Print
Pages: 1 2 [3] 4 5
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Theming and Appearance Customization
| | |-+  [App] Rockbox Font Convertor [Windows]
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.16 seconds with 22 queries.