Jump to content











Photo
- - - - -

grub4dos menu font type


  • Please log in to reply
8 replies to this topic

#1 planejanez

planejanez

    Newbie

  • Members
  • 10 posts
  • Location:Tucson, Arizona
  • Interests:Programming
    XBOX Call of Duty
  •  
    United States

Posted 22 October 2013 - 02:19 AM

I'm currently using grub4dos along with gfxmenu to produce a nice looking menu. I like the font type, size and the placement of the font (text) on the screen. I actually didn't have to make any modifications, except to the background image. Anyways, I was looking into the built in menu system that grub4dos provides. The default menu is just horrible looking in my opinion. I prefer to have nice high res background, with some nice looking fonts.

 

I decided to do some digging to see if I could just modify the grub4dos menu system to my needs. I ran into an immediate snag. It appears the font type can't be changed. I looked into the unifont.hex.gz file to use as a font, and the file is actually a unicode listing in hex format of numerous different languages. To make the file size smaller for just my needs I opened the file in a text editor, and removed everything after line 256 which is not related to the English language. File size dropped down to around 11kb from close to 1mb. I still don't understand how the file completely works to produce font (text), but that a little besides the point.

 

My question is how do I change the font type, size etc of the grub4dos built in menu?



#2 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13596 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 22 October 2013 - 07:50 AM

The font is a "GNU unifont" (whatever it is):

http://en.wikipedia....iki/GNU_Unifont

but can be changed only in "graphic mode" (AFAIK), see:

http://www.rmprepusb...g-the-text-font

http://www.rmprepusb...ts-and-graphics

The font in "text mode" is - I believe - "embedded" and I don't think they can be changed.

 

:cheers:

Wonko



#3 steve6375

steve6375

    Platinum Member

  • Developer
  • 6597 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars
  •  
    United Kingdom

Posted 22 November 2013 - 08:55 PM

If it is of any use, see my blog for a description of how to define characters from within a menu.lst file.

I have not been able to find any alternative hex fonts for grub4dos (even with just a Latin/ASCII font, 0-FF character set).

I don't think grub4dos copes with a re-sizeable font - the unifont hex file defines single width characters (8 bits across) or double width glyphs (16 bits across) - thus the size is fixed.

I would have thought that I could find bold and italic fonts but can't seem to find them.???

Other more sophisticated fonts (e.g. Arial, Courier, etc.) would be hard to do as there is only an 8x8 or 16x8 grid to work with.



#4 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13596 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 24 November 2013 - 10:53 AM

If anyone want to play with this, there are some possibilities.
The "unifont" format is "easy", actually so easy that I can understand and manage it in batch :w00t:
There is a nice little tool, here:
Raster Font Editor by Cylog Software
http://www.cylog.org...rfonteditor.jsp
that has - among other features - the one of "importing" fonts and outputting them in a "text" format very similar to the one Unifont uses.
The tool can import both TTF and the good ol' "DOS" 8x16 format.
While the result of importing a TTF may (largely) vary, any DOS 8x16 font will work VERY nicely, since unifont is basically an 8x16 font.
I put together a couple of the usual half-@§§ed batches.
As always no particular instructions/help with them, the first fonttxt2uni.cmd will parse a .txt file exported from the Cylog font editor and make a .uni file (in the format of unifont 8x16), the showchar.cmd is a batch replacement for the PERL hexdraw command.
The scripts have been briefly tested in converting the FreeDOS file terminus (terminus.f16):
http://ftp.ibiblio.o...ts/terminus.zip
into unifont format.
It will only work for chars 0 to 255 (or 00 to FF).
As an example, this is the output of showchar.cmd (to be compared with the example on Wikipedia's page):
http://en.wikipedia....Unifont#Example
D:\Font_bitmap>Showchar.cmd terminus.uni 41
0041:00003C424242427E4242424200000000
........ 0x00
........ 0x00
..@@@@.. 0x3C
.@....@. 0x42
.@....@. 0x42
.@....@. 0x42
.@....@. 0x42
.@@@@@@. 0x7E
.@....@. 0x42
.@....@. 0x42
.@....@. 0x42
.@....@. 0x42
........ 0x00
........ 0x00
........ 0x00
........ 0x00
Have fun. :)
:cheers:
Wonko

P.S.: Some other fonts that are in the "right" DOS format can be found here:
http://www.ctan.org/...tilities/ega2mf
D:\Font_bitmap>Showchar.cmd cp850vga.uni 41
0041:000010386CC6C6FEC6C6C6C600000000
........ 0x00
........ 0x00
...@.... 0x10
..@@@... 0x38
.@@.@@.. 0x6C
@@...@@. 0xC6
@@...@@. 0xC6
@@@@@@@. 0xFE
@@...@@. 0xC6
@@...@@. 0xC6
@@...@@. 0xC6
@@...@@. 0xC6
........ 0x00
........ 0x00
........ 0x00
........ 0x00
A few more (nice) ones inside this good ol' freeware by Horst Schaeffer:
http://cd.textfiles....isk1/DISC1/VGA/
http://cd.textfiles....GA/FPMAN220.ZIP



D:\Font_bitmap>Showchar.cmd flori.uni 41
0041:00001E33636363FF636363E300000000
........ 0x00
........ 0x00
...@@@@. 0x1E
..@@..@@ 0x33
.@@...@@ 0x63
.@@...@@ 0x63
.@@...@@ 0x63
@@@@@@@@ 0xFF
.@@...@@ 0x63
.@@...@@ 0x63
.@@...@@ 0x63
@@@...@@ 0xE3
........ 0x00
........ 0x00
........ 0x00
........ 0x00

Attached Files



#5 steve6375

steve6375

    Platinum Member

  • Developer
  • 6597 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars
  •  
    United Kingdom

Posted 24 November 2013 - 07:00 PM

Thanks Wonko  :good:

Here is a grub4dos demo screenshot of a few fonts I have made. 

The first one is the normal BIOS font.

 

Attached Thumbnails

  • fontdemo1.jpg


#6 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13596 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 25 November 2013 - 10:38 AM

Thanks Wonko  :good:
Here is a grub4dos demo screenshot of a few fonts I have made. 
The first one is the normal BIOS font.

Good :).
I also did a few experiments.
The issue with TTF fonts is that they are mostly "proportional" and "largish".
The three "larger" characters which are @, M and W (and more rarely O and Q)will fail to fit in the "8 pixels width" and their "native" proportionality will make the i and j's (or more generally the "narrow" letters) space "too much".
Two "common" fonts that "convert rather nicely", for different reasons, are Arial Narrow (which being "narrow" fits in the grid alright, but may need manual correction of the @ and of the spacing/centering of i's and j's) and Courier New.
So, loosely, to attempt the conversion of a TTF font, it is better if it is "fixed width/non-proportional" and has "narrowish" characters.

:cheers:
Wonko

P.S.: The Start2P font:
http://www.zone38.net/font/
imported at a font size of 6 :w00t: seems like making a nice smallish but boldish font :smiling9:

#7 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13596 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 25 November 2013 - 04:40 PM

I found another nice set of DOS fonts here:
 
http://www.retroarch...reen/index.html
fontpack.zip
 








 +---------------------------------------------------------------------+
  ¦                        - FONTPACK V1.0 -                            ¦
  ¦          A collection of screen fonts for VGA Text Mode             ¦
  +---------------------------------------------------------------------¦
  ¦          Freeware 1993 - Tim Sneath <tjs@cs.nott.ac.uk>             ¦
  +---------------------------------------------------------------------+

   These VGA screen fonts are all .COM files, which means that you don't
   need any special programs to load them in.  Just type the name of the
   font in and the screen will change to that font.  The fonts available
   are as follows:

   
     Name of file ¦# Ln¦ Brief description
     -------------+----+----------------------------------------------
     28STD.COM    ¦ 28 ¦ Standard weight font
     ANTIQUE.COM  ¦ 25 ¦ Tall, stylised font with large x-height
     APL.COM      ¦ 28 ¦ Font with extra chars. for the APL language
     BROADWAY.COM ¦ 25 ¦ Twenties-style font
     COURIER.COM  ¦ 25 ¦ Font with 'typewriter' look
     GREEK.COM    ¦ 25 ¦ Greek character font
     HISQUASH.COM ¦ 50 ¦ Rather 'gappy' font
     HISTD.COM    ¦ 50 ¦ Standard font
     HITHIN.COM   ¦ 50 ¦ Light-weighted font
     IBM.COM      ¦ 25 ¦ The original and best!
     LITE.COM     ¦ 25 ¦ A thinner version of the IBM font
     MEDIEVAL.COM ¦ 25 ¦ Very nice mediaeval-style font
     ROMAN.COM    ¦ 25 ¦ Good, clear, easy-to-read alternative
     SANS.COM     ¦ 25 ¦ A sans-serif version of the IBM font
     SANS2.COM    ¦ 25 ¦ Another (not so nice, IMHO) sans-serif font
     SCRIPT.COM   ¦ 25 ¦ A joined-up handwriting font!
     SQUASHED.COM ¦ 28 ¦ Rather gappy sans-serif font
     STANDARD.COM ¦ 25 ¦ An IBM-clone font (compare with IBM.COM)
     THIN.COM     ¦ 28 ¦ A thin sans-serif font

   The  fonts  were  created  with the PC-Magazine FONTEDIT.COM freeware
   program,  which  can  be   found  on  many  BBSes  and  also  on  the
   WSMR-SIMTEL20.ARMY.MIL Internet FTP site. Have lots of fun with them!
   
   Tim Sneath <tjs@cs.nott.ac.uk>


There is the need to convert them from .com to .F16, and then from .F16 to .uni.
There is actually no particular need, once you have some "proper ".F16" files (which you might find also as .vga, .fnt, etc.), i.e. 8x16 Bitmap fonts sized exactly 4,096 bytes of importing with the Cylog utility and saving in the intermediate .txt format.
I put together a couple of the as usual half-@§§ed batches, these will require some utilities from the DSFOK toolkit and/or dumphex.exe, in case:
http://members.ozema...eezip/freeware/
http://rbach.priv.at/DumpHex/
COM_fonts_2_F16.cmd is "specific" to the files in fontpack.zip (some of the files are actually 8x14 and some 8x8 and need inserting blank lines of pixels, but it can be used as an example for the parsing of similar "embedded" files)
F16_to_UNI.cmd is instead "generic" and can be used to convert *any* .F16 file to .uni without need of importing with the Cylog utility and saving in the intermediate .txt format.
In the attached archive I put also the set of .F16 and .uni files already converted.
 
@Steve6375
If you have time/will, can you post a screenshot with the new 19 (nineteen!) fonts?
(the "greek" one is possibly less useful than the others, but all seem to me like nice).
 
:cheers:
jaclaz

Attached Files



#8 steve6375

steve6375

    Platinum Member

  • Developer
  • 6597 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars
  •  
    United Kingdom

Posted 25 November 2013 - 08:29 PM

Here is the result

not bad! :good:

Attached Thumbnails

  • fontuni.jpg


#9 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13596 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 26 November 2013 - 09:11 AM

Yep. :)

Nice result overall. :thumbup:

I guess that with this we have more or less the whole range of possible font styles (since we are limited to the 8x16 or smaller).

One that misses is the "modern" (please read as "by now vintage" :w00t:) font style that PLoP uses, I had a quick look around, but couldn't find one, though I am sure there was at least one with that look for DOS/VGA.

A huge set is here:

ftp://ftp.columbia.edu/kermit/pcfonts/

the two archives fntcol15.zip and fntcol16.zip are choking full of VGA fonts (the fntcol16 includes all the fonts in fntcol15), of which many are 8x16.

Among them the CNTDOWN.F16and the LB_OCR.F16 are similar to the "PLoP" font I was talking about, the ART.F16, DECORATE.F16, and WIGGLY.F16 seem to me like very readable "stylish" fonts, but also the READABL7.F16 and READABL8.F16 are nice.

The rest seem at first sight similar to already found fonts or not really useful/usable. :dubbio:

 

:cheers:
Wonko






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users