Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
7
rated 0 times [  7] [ 0]  / answers: 1 / hits: 693  / 1 Year ago, tue, february 21, 2023, 1:46:37

I sometimes need work with .fon bitmap font files.


When I try to set a default application for them (using the GUI), it also changes the application for .exe files, and vice versa. But I'm trying to associate two different applications with those (a font editor for .fon, and Wine for .exe).


The MIME type for both appears to be application/x-ms-dos-executable.


file identifies those .fon files as MS-DOS executable, NE for MS Windows 3.x (DLL or font). "NE executable" appears to be an outdated format, so considering any NE executable a font (as opposed to PE) would be a reasonable tradeoff, but I'm not sure how to do that.


More From » mime-type

 Answers
5

You need to register a new MIME type for .fon files into the MIME database:



  • First, create an XML file in /usr/share/mime/packages:


    sudo nano /usr/share/mime/packages/ms-fon.xml


  • Copy these lines into the file (use Ctrl+C to copy and Ctrl+Shift+V to paste into nano window):


    <?xml version="1.0" encoding="UTF-8"?>
    <mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
    <mime-type type="application/x-ms-fon">
    <comment>Windows FON file</comment>
    <generic-icon name="font-x-generic"/>
    <glob pattern="*.fon"/>
    </mime-type>
    </mime-info>


  • Press Ctrl+O and Enter to save the file, and Ctrl+X to exit nano and return to the terminal.



  • Finally, update the MIME database:


    sudo update-mime-database /usr/share/mime



Now the MIME type for your .fon files will be application/x-ms-fon while that for .exe files remains the same. You should be able to associate different applications with those types now.


Reference: https://developer.gnome.org/documentation/guidelines/maintainer/integrating.html#mime-types


[#747] Tuesday, February 21, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ligdesig

Total Points: 164
Total Questions: 106
Total Answers: 114

Location: Japan
Member since Sat, Jun 6, 2020
4 Years ago
ligdesig questions
;