grub-mkfont input and output formtas

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












2















I have a font that I can set using setfont and rc.conf [CONSOLEFONT]. It is in psf2 format. I would like to use the font in Grub as well. I'm using Grub2. When I run



grub-mkfont -o ~/outfont pc.psf


I get the output



can't open file pc.pf2, index 0: error 2: unknown file format


Although the man page is a bit lacking, from what I've read elsewhere, it looks like grub-mkfont should be able to take an host of input formats (including psf2?) and outputs a psf2 font. This doesn't match what I see. I have a grub font that works, and I notice that it doesn't have the psf2 "magic" at the top, but rather it starts with FILE , 0,0,0,4 (bytes), PFF2NAME, etc. and generally looks like a text/binary mixed format wit things like MAXH, Regular 16, FAMI, etc. in it. Is Grub2 different in this regard?



The quest is: What format does grub-mkfont take and output? How can I convert my psf2 font into that format?



It looks like information about these things is somewhat scarce, so please offer information even if you can't fully answer the question! Anything small could be big! Thanks.










share|improve this question




























    2















    I have a font that I can set using setfont and rc.conf [CONSOLEFONT]. It is in psf2 format. I would like to use the font in Grub as well. I'm using Grub2. When I run



    grub-mkfont -o ~/outfont pc.psf


    I get the output



    can't open file pc.pf2, index 0: error 2: unknown file format


    Although the man page is a bit lacking, from what I've read elsewhere, it looks like grub-mkfont should be able to take an host of input formats (including psf2?) and outputs a psf2 font. This doesn't match what I see. I have a grub font that works, and I notice that it doesn't have the psf2 "magic" at the top, but rather it starts with FILE , 0,0,0,4 (bytes), PFF2NAME, etc. and generally looks like a text/binary mixed format wit things like MAXH, Regular 16, FAMI, etc. in it. Is Grub2 different in this regard?



    The quest is: What format does grub-mkfont take and output? How can I convert my psf2 font into that format?



    It looks like information about these things is somewhat scarce, so please offer information even if you can't fully answer the question! Anything small could be big! Thanks.










    share|improve this question


























      2












      2








      2


      1






      I have a font that I can set using setfont and rc.conf [CONSOLEFONT]. It is in psf2 format. I would like to use the font in Grub as well. I'm using Grub2. When I run



      grub-mkfont -o ~/outfont pc.psf


      I get the output



      can't open file pc.pf2, index 0: error 2: unknown file format


      Although the man page is a bit lacking, from what I've read elsewhere, it looks like grub-mkfont should be able to take an host of input formats (including psf2?) and outputs a psf2 font. This doesn't match what I see. I have a grub font that works, and I notice that it doesn't have the psf2 "magic" at the top, but rather it starts with FILE , 0,0,0,4 (bytes), PFF2NAME, etc. and generally looks like a text/binary mixed format wit things like MAXH, Regular 16, FAMI, etc. in it. Is Grub2 different in this regard?



      The quest is: What format does grub-mkfont take and output? How can I convert my psf2 font into that format?



      It looks like information about these things is somewhat scarce, so please offer information even if you can't fully answer the question! Anything small could be big! Thanks.










      share|improve this question
















      I have a font that I can set using setfont and rc.conf [CONSOLEFONT]. It is in psf2 format. I would like to use the font in Grub as well. I'm using Grub2. When I run



      grub-mkfont -o ~/outfont pc.psf


      I get the output



      can't open file pc.pf2, index 0: error 2: unknown file format


      Although the man page is a bit lacking, from what I've read elsewhere, it looks like grub-mkfont should be able to take an host of input formats (including psf2?) and outputs a psf2 font. This doesn't match what I see. I have a grub font that works, and I notice that it doesn't have the psf2 "magic" at the top, but rather it starts with FILE , 0,0,0,4 (bytes), PFF2NAME, etc. and generally looks like a text/binary mixed format wit things like MAXH, Regular 16, FAMI, etc. in it. Is Grub2 different in this regard?



      The quest is: What format does grub-mkfont take and output? How can I convert my psf2 font into that format?



      It looks like information about these things is somewhat scarce, so please offer information even if you can't fully answer the question! Anything small could be big! Thanks.







      terminal grub2






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jun 19 '12 at 17:17







      Limited Atonement

















      asked Jun 19 '12 at 16:22









      Limited AtonementLimited Atonement

      22318




      22318




















          1 Answer
          1






          active

          oldest

          votes


















          1














          I know this question is old, but I still wanted to share what I found as this is still relevant. In my case, I was trying to convert the Terminus Bold font.



          Warning: do not feel too motivated, I still couldn't convert psf to pf2 in the end, but others have reported that it did work for them. Maybe you will be one of the lucky ones. It may also depend on which font you want to convert. I did however manage to download the font I wanted in another format that could be converted by grub-mkfont. Read on.



          Please note that psf2 is not the same as pf2! Psf2 is what the console uses, pf2 is what GRUB uses. I will use psf instead of psf2 in this answer as that is the extension commonly used for that file format.



          After finding this page, my thought process was: if grub-mkfont doesn't understand psf, is there something I can convert psf to (preferably bit-mapped and lossless) that grub-mkfont does understand? The answer was bdf.



          (grub-mkfont understands anything the FreeType library understands)



          The answer I found was that PSF Tools could convert psf to bdf, so I compiled it and converted my psf font to bdf, but grub-mkfont complained that it had an invalid font size (24x24), however, the font itself is 24x12:



          grub-mkfont: error: can't set 24x24 font size: Freetype error 23: invalid pixel size.


          Looking into the bdf file, I saw that the size is indeed set as 24x12.
          This was a font size that is only supported with a framebuffer in the Linux console, but I also tried smaller VGA sizes and ran into the same issue. I concluded that this was a bug in either PSF Tools or grub-mkfont.



          Then, I continued searching and found a utility called gbdfed (which, lucky for me, was in the Ubuntu repositories) that can import psf and save as bdf.



          Now, grub-mkfont parsed it without complaining (so the previous problem was in PSF Tools, not grub-mkfont) but the resulting pf2 font contained exactly zero glyphs. Again, I tried a VGA version, messed with the arguments for grub-mkfont and nothing worked.



          In the end, I found out that the psf files I was trying to convert to bdf were actually bdf in their source form, so I traced down the original bdf file and this time, grub-mkfont actually accepted it and created a valid pf2! I still haven't tested it, though, because I need to get some sleep now, but the only problem I could possibly have now is that I have too many glyphs in the pf2 for GRUB to understand.



          I am sorry in case my English is hard to understand, it's not my native language.






          share|improve this answer

























          • Welcome to Unix Stack Exchange, and bravo on the research! I don't use the frame buffer much anymore, but this is useful information here. I would up creating a psf2 font creator from raster fonts (like Proggy Square), but I don't remember noting a difference between psf2 and pf2!

            – Limited Atonement
            Jan 5 at 23:29






          • 1





            Yes. PSF stands for PC Screen Font, while the pf2 extension is used for PFF2 fonts (PUPA Font Format), which was specifically invented for GRUB to make the font handling code simpler.

            – fghsgh
            Jan 7 at 20:15










          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f41132%2fgrub-mkfont-input-and-output-formtas%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          I know this question is old, but I still wanted to share what I found as this is still relevant. In my case, I was trying to convert the Terminus Bold font.



          Warning: do not feel too motivated, I still couldn't convert psf to pf2 in the end, but others have reported that it did work for them. Maybe you will be one of the lucky ones. It may also depend on which font you want to convert. I did however manage to download the font I wanted in another format that could be converted by grub-mkfont. Read on.



          Please note that psf2 is not the same as pf2! Psf2 is what the console uses, pf2 is what GRUB uses. I will use psf instead of psf2 in this answer as that is the extension commonly used for that file format.



          After finding this page, my thought process was: if grub-mkfont doesn't understand psf, is there something I can convert psf to (preferably bit-mapped and lossless) that grub-mkfont does understand? The answer was bdf.



          (grub-mkfont understands anything the FreeType library understands)



          The answer I found was that PSF Tools could convert psf to bdf, so I compiled it and converted my psf font to bdf, but grub-mkfont complained that it had an invalid font size (24x24), however, the font itself is 24x12:



          grub-mkfont: error: can't set 24x24 font size: Freetype error 23: invalid pixel size.


          Looking into the bdf file, I saw that the size is indeed set as 24x12.
          This was a font size that is only supported with a framebuffer in the Linux console, but I also tried smaller VGA sizes and ran into the same issue. I concluded that this was a bug in either PSF Tools or grub-mkfont.



          Then, I continued searching and found a utility called gbdfed (which, lucky for me, was in the Ubuntu repositories) that can import psf and save as bdf.



          Now, grub-mkfont parsed it without complaining (so the previous problem was in PSF Tools, not grub-mkfont) but the resulting pf2 font contained exactly zero glyphs. Again, I tried a VGA version, messed with the arguments for grub-mkfont and nothing worked.



          In the end, I found out that the psf files I was trying to convert to bdf were actually bdf in their source form, so I traced down the original bdf file and this time, grub-mkfont actually accepted it and created a valid pf2! I still haven't tested it, though, because I need to get some sleep now, but the only problem I could possibly have now is that I have too many glyphs in the pf2 for GRUB to understand.



          I am sorry in case my English is hard to understand, it's not my native language.






          share|improve this answer

























          • Welcome to Unix Stack Exchange, and bravo on the research! I don't use the frame buffer much anymore, but this is useful information here. I would up creating a psf2 font creator from raster fonts (like Proggy Square), but I don't remember noting a difference between psf2 and pf2!

            – Limited Atonement
            Jan 5 at 23:29






          • 1





            Yes. PSF stands for PC Screen Font, while the pf2 extension is used for PFF2 fonts (PUPA Font Format), which was specifically invented for GRUB to make the font handling code simpler.

            – fghsgh
            Jan 7 at 20:15















          1














          I know this question is old, but I still wanted to share what I found as this is still relevant. In my case, I was trying to convert the Terminus Bold font.



          Warning: do not feel too motivated, I still couldn't convert psf to pf2 in the end, but others have reported that it did work for them. Maybe you will be one of the lucky ones. It may also depend on which font you want to convert. I did however manage to download the font I wanted in another format that could be converted by grub-mkfont. Read on.



          Please note that psf2 is not the same as pf2! Psf2 is what the console uses, pf2 is what GRUB uses. I will use psf instead of psf2 in this answer as that is the extension commonly used for that file format.



          After finding this page, my thought process was: if grub-mkfont doesn't understand psf, is there something I can convert psf to (preferably bit-mapped and lossless) that grub-mkfont does understand? The answer was bdf.



          (grub-mkfont understands anything the FreeType library understands)



          The answer I found was that PSF Tools could convert psf to bdf, so I compiled it and converted my psf font to bdf, but grub-mkfont complained that it had an invalid font size (24x24), however, the font itself is 24x12:



          grub-mkfont: error: can't set 24x24 font size: Freetype error 23: invalid pixel size.


          Looking into the bdf file, I saw that the size is indeed set as 24x12.
          This was a font size that is only supported with a framebuffer in the Linux console, but I also tried smaller VGA sizes and ran into the same issue. I concluded that this was a bug in either PSF Tools or grub-mkfont.



          Then, I continued searching and found a utility called gbdfed (which, lucky for me, was in the Ubuntu repositories) that can import psf and save as bdf.



          Now, grub-mkfont parsed it without complaining (so the previous problem was in PSF Tools, not grub-mkfont) but the resulting pf2 font contained exactly zero glyphs. Again, I tried a VGA version, messed with the arguments for grub-mkfont and nothing worked.



          In the end, I found out that the psf files I was trying to convert to bdf were actually bdf in their source form, so I traced down the original bdf file and this time, grub-mkfont actually accepted it and created a valid pf2! I still haven't tested it, though, because I need to get some sleep now, but the only problem I could possibly have now is that I have too many glyphs in the pf2 for GRUB to understand.



          I am sorry in case my English is hard to understand, it's not my native language.






          share|improve this answer

























          • Welcome to Unix Stack Exchange, and bravo on the research! I don't use the frame buffer much anymore, but this is useful information here. I would up creating a psf2 font creator from raster fonts (like Proggy Square), but I don't remember noting a difference between psf2 and pf2!

            – Limited Atonement
            Jan 5 at 23:29






          • 1





            Yes. PSF stands for PC Screen Font, while the pf2 extension is used for PFF2 fonts (PUPA Font Format), which was specifically invented for GRUB to make the font handling code simpler.

            – fghsgh
            Jan 7 at 20:15













          1












          1








          1







          I know this question is old, but I still wanted to share what I found as this is still relevant. In my case, I was trying to convert the Terminus Bold font.



          Warning: do not feel too motivated, I still couldn't convert psf to pf2 in the end, but others have reported that it did work for them. Maybe you will be one of the lucky ones. It may also depend on which font you want to convert. I did however manage to download the font I wanted in another format that could be converted by grub-mkfont. Read on.



          Please note that psf2 is not the same as pf2! Psf2 is what the console uses, pf2 is what GRUB uses. I will use psf instead of psf2 in this answer as that is the extension commonly used for that file format.



          After finding this page, my thought process was: if grub-mkfont doesn't understand psf, is there something I can convert psf to (preferably bit-mapped and lossless) that grub-mkfont does understand? The answer was bdf.



          (grub-mkfont understands anything the FreeType library understands)



          The answer I found was that PSF Tools could convert psf to bdf, so I compiled it and converted my psf font to bdf, but grub-mkfont complained that it had an invalid font size (24x24), however, the font itself is 24x12:



          grub-mkfont: error: can't set 24x24 font size: Freetype error 23: invalid pixel size.


          Looking into the bdf file, I saw that the size is indeed set as 24x12.
          This was a font size that is only supported with a framebuffer in the Linux console, but I also tried smaller VGA sizes and ran into the same issue. I concluded that this was a bug in either PSF Tools or grub-mkfont.



          Then, I continued searching and found a utility called gbdfed (which, lucky for me, was in the Ubuntu repositories) that can import psf and save as bdf.



          Now, grub-mkfont parsed it without complaining (so the previous problem was in PSF Tools, not grub-mkfont) but the resulting pf2 font contained exactly zero glyphs. Again, I tried a VGA version, messed with the arguments for grub-mkfont and nothing worked.



          In the end, I found out that the psf files I was trying to convert to bdf were actually bdf in their source form, so I traced down the original bdf file and this time, grub-mkfont actually accepted it and created a valid pf2! I still haven't tested it, though, because I need to get some sleep now, but the only problem I could possibly have now is that I have too many glyphs in the pf2 for GRUB to understand.



          I am sorry in case my English is hard to understand, it's not my native language.






          share|improve this answer















          I know this question is old, but I still wanted to share what I found as this is still relevant. In my case, I was trying to convert the Terminus Bold font.



          Warning: do not feel too motivated, I still couldn't convert psf to pf2 in the end, but others have reported that it did work for them. Maybe you will be one of the lucky ones. It may also depend on which font you want to convert. I did however manage to download the font I wanted in another format that could be converted by grub-mkfont. Read on.



          Please note that psf2 is not the same as pf2! Psf2 is what the console uses, pf2 is what GRUB uses. I will use psf instead of psf2 in this answer as that is the extension commonly used for that file format.



          After finding this page, my thought process was: if grub-mkfont doesn't understand psf, is there something I can convert psf to (preferably bit-mapped and lossless) that grub-mkfont does understand? The answer was bdf.



          (grub-mkfont understands anything the FreeType library understands)



          The answer I found was that PSF Tools could convert psf to bdf, so I compiled it and converted my psf font to bdf, but grub-mkfont complained that it had an invalid font size (24x24), however, the font itself is 24x12:



          grub-mkfont: error: can't set 24x24 font size: Freetype error 23: invalid pixel size.


          Looking into the bdf file, I saw that the size is indeed set as 24x12.
          This was a font size that is only supported with a framebuffer in the Linux console, but I also tried smaller VGA sizes and ran into the same issue. I concluded that this was a bug in either PSF Tools or grub-mkfont.



          Then, I continued searching and found a utility called gbdfed (which, lucky for me, was in the Ubuntu repositories) that can import psf and save as bdf.



          Now, grub-mkfont parsed it without complaining (so the previous problem was in PSF Tools, not grub-mkfont) but the resulting pf2 font contained exactly zero glyphs. Again, I tried a VGA version, messed with the arguments for grub-mkfont and nothing worked.



          In the end, I found out that the psf files I was trying to convert to bdf were actually bdf in their source form, so I traced down the original bdf file and this time, grub-mkfont actually accepted it and created a valid pf2! I still haven't tested it, though, because I need to get some sleep now, but the only problem I could possibly have now is that I have too many glyphs in the pf2 for GRUB to understand.



          I am sorry in case my English is hard to understand, it's not my native language.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jan 5 at 10:32

























          answered Jan 4 at 23:53









          fghsghfghsgh

          112




          112












          • Welcome to Unix Stack Exchange, and bravo on the research! I don't use the frame buffer much anymore, but this is useful information here. I would up creating a psf2 font creator from raster fonts (like Proggy Square), but I don't remember noting a difference between psf2 and pf2!

            – Limited Atonement
            Jan 5 at 23:29






          • 1





            Yes. PSF stands for PC Screen Font, while the pf2 extension is used for PFF2 fonts (PUPA Font Format), which was specifically invented for GRUB to make the font handling code simpler.

            – fghsgh
            Jan 7 at 20:15

















          • Welcome to Unix Stack Exchange, and bravo on the research! I don't use the frame buffer much anymore, but this is useful information here. I would up creating a psf2 font creator from raster fonts (like Proggy Square), but I don't remember noting a difference between psf2 and pf2!

            – Limited Atonement
            Jan 5 at 23:29






          • 1





            Yes. PSF stands for PC Screen Font, while the pf2 extension is used for PFF2 fonts (PUPA Font Format), which was specifically invented for GRUB to make the font handling code simpler.

            – fghsgh
            Jan 7 at 20:15
















          Welcome to Unix Stack Exchange, and bravo on the research! I don't use the frame buffer much anymore, but this is useful information here. I would up creating a psf2 font creator from raster fonts (like Proggy Square), but I don't remember noting a difference between psf2 and pf2!

          – Limited Atonement
          Jan 5 at 23:29





          Welcome to Unix Stack Exchange, and bravo on the research! I don't use the frame buffer much anymore, but this is useful information here. I would up creating a psf2 font creator from raster fonts (like Proggy Square), but I don't remember noting a difference between psf2 and pf2!

          – Limited Atonement
          Jan 5 at 23:29




          1




          1





          Yes. PSF stands for PC Screen Font, while the pf2 extension is used for PFF2 fonts (PUPA Font Format), which was specifically invented for GRUB to make the font handling code simpler.

          – fghsgh
          Jan 7 at 20:15





          Yes. PSF stands for PC Screen Font, while the pf2 extension is used for PFF2 fonts (PUPA Font Format), which was specifically invented for GRUB to make the font handling code simpler.

          – fghsgh
          Jan 7 at 20:15

















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Unix & Linux Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f41132%2fgrub-mkfont-input-and-output-formtas%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown






          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Bahrain

          Postfix configuration issue with fips on centos 7; mailgun relay