VideoHelp Forum
+ Reply to Thread
Results 1 to 2 of 2
Thread
  1. Explorer Case's Avatar
    Join Date
    Feb 2004
    Location
    Middle Earth
    Search Comp PM
    Using subtitle fonts in ffmpegX



    ffmpegX comes with its own set of fonts for subtitling purposes. These 19 (as of v0.0.9y-L) fonts are only used by ffmpegX. Some of these may have the same name as fonts you already have installed, but they are different. Different version of fonts, different number of glyphs (characters). This distinction is important, as you may be editing an .srt file with a certain character that is not present in the ffmpegX version of the font, and thus will not show up after encoding. Typically, missing characters are substituted by the underscore character (_) for subtitle rendering.

    These fonts can be used by mplayer/mencoder. All these fonts are Windows TrueType fonts; I believe mplayer only recognizes this font format.

    The fonts are:
    • Arial (Latin), v2.60; 242 glyphs (Office 2011 version has 3415 glyphs)
    • Times (Latin), v 3.5a3; 392 glyphs (The Mountain Lion system font of the same name has 1443 glyphs)
    • Geneva (Latin), v3.5a3; 397 glyphs (ML system font has 2718 glyphs)
    • CurlzMT (Latin), v1.01; 251 glyphs (ML system font has 251 glyphs)
    • Gadget (Latin), v3.5a3, 459 glyphs (also known from Mac OS 9)
    • Georgia (Latin), v2.05, 249 glyphs (ML system font has 1134 glyphs)
    • TrebuchetMS (Latin), v1.15; 309 glyphs (ML system font has 581 glyphs)
    • Optima (Latin) (=Optima family), v1.0d19; 268 glyphs (ML system font has 268 glyphs)
    • ArialHebrew (Hebrew), v4.1d3e1; 187 glyphs (ML system font has 189 glyphs)
    • AyuthayaThai (Thai, Latin, Cyrillic), v10.3d2e1, 964 glyphs (ML system font has 967 glyphs)
    • AlBayan (Arabic), v4.1d3e1; 265 glyphs (ML system font has 279 glyphs)
    • Cyrillic (Cyrillic, Latin) (=GenevaCY), v4.1d1e1; 231 glyphs (ML system font has 231 glyphs)
    • DevanagariMT (Devanagari [India]), v4.1d4e4, 539 glyphs (ML system font has 549 glyphs)
    • GujaratiMT (Gujarati [India]), v4.1d4e3; 462 glyphs (ML system font has 465 glyphs)
    • Mshtakan (Armenian), v4.1d2; 184 glyphs (ML system font has 178 glyphs)
    • LiGothic (Simplified+Traditional Han [China], Latin) (=Apple LiGothic Medium), v4.1d1e1; 13701 glyphs (ML system font has 13701 glyphs)
    • Osaka (Japanese, Latin, Cyrillic), v4.2; 8121 glyphs (ML system font has 8121 glyphs)
    • SPIonic (Greek), 1998; 99 glyphs (free font from Scholars Press)
    • STHeiti (Simplified+Traditional Han [China], Arabic, Cyrillic, Greek, Hiragana [Japan], Latin, Tibetan, Yi [China]), v4.1d3e1, 32493 glyphs (ML system font has 32493 glyphs)
    Here is a sample of a subtitle line rendered in the available fonts:
    (The non-Latin parts come from an online translation. My apologies to the people who can read it and see mistakes in here.)


    If you choose a font for your subtitles, be sure that this font has all the glyphs that are used in your subtitle file. You can preview the subtitle rendering using the Preview button in the bottom right of the Filters tab. The start time applies for playback. Set it to 0:00 if needed.

    Among the Western languages, especially Greek has few options with these fonts. Modern Greek can use lots of diacritics that are only available in one of these fonts: STHeiti.

    Besides using a font that has all the needed glyphs, you also need to set the text-encoding ("code page") that is used in the subtitle file. This defines the way that the characters are set (numbered) in the file. If it doesn't match, then you will see unintended and maybe weird characters, or missing characters, even if the font choice was good.
    If e.g. a subtitle file uses ISO-8859-1, then also set this in ffmpegX.
    If e.g. a subtitle file uses UTF-8, then also set this in ffmpegX.
    If e.g. a subtitle file uses ISO 8859-7, then also set this in ffmpegX.
    If e.g. a subtitle file uses Windows-1253, then set "CP1253" in ffmpegX.
    If e.g. a subtitle file uses Windows-1252, then set "CP1252" in ffmpegX.
    It doesn't matter much which one is used, as long as you tell ffmpegX about it.

    (to be continued…)
    Last edited by Case; 17th Aug 2012 at 10:13.
    Quote Quote  
  2. Explorer Case's Avatar
    Join Date
    Feb 2004
    Location
    Middle Earth
    Search Comp PM
    Using subtitle fonts in ffmpegX, part 2

    Here is a little hack that is possible:
    The fonts can be exchanged for any font you like. You can exchange fonts for versions with more glyphs, or totally different ones.

    It is not (easily) possible to change the GUI, so the font list in ffmpegX will stay as it is. That means that you will have to remember what you changed, as the changes are not visible when using the program. That is why I would call it a “dirty hack”. The change gets the job done, but it is not in a pretty way.

    The most versatile option would be to use Arial Unicode (50,000+ glyphs!) instead of the regular Arial. If you do this, you can use your new Arial for any subtitle text, as it covers just about any glyph in any script/language that a subtitle can have.

    But maybe (ha!) you don't like Arial, and maybe you have a font you would like to use instead of any of the other options.
    Maybe you have a font that is easier to read on screen, with characters that do not look much like other characters.
    Maybe you found the name of a very cool, yet easily readable font that you saw used in a movie/on tv.

    As said before, the font format for this use needs to be Windows TrueType (.ttf). If your font is in a different format, then you will need to convert it first.
    Some time ago, you needed special font editors to save in a different format, but now there are online font converters available. Upload, select a new format, download, done.

    The standard ffmpegX fonts are installed into ~/.spumux/ . That is an invisible directory inside your home directory. (All filenames and folder names that start with a dot (.) are invisible on Mac OS X.)
    You can see the content of this directory by using the Finder menu Go > Go to Folder… (⇧⌘G), and type there: ~/.spumux
    The folder has read/write privileges for user 'system' only. That means you'll have to authenticate (enter your admin password) for every change you make. To make it easier for yourself, set read/write privileges for everyone. You can do this in the Get Info window for the folder.

    The filename is very important for this. Your new font should have the exact same name as the one you are replacing. You can put as many files as you wish in that folder, but only the files with the original names will be accessible for ffmpegX.
    Copy the filename of the old font. Rename your new font (still in another location) with that name. Rename the old font by appending “-old” to the name (as sort of a backup). Move the new font to the .spumux folder.

    For example, you think you will never need CurlzMT, but you would like to use Tiresias. Then exchange these two fonts, as detailed above. When you select CurlzMT in ffmpegX, then Tiresias will be used for your subtitles.

    Last edited by Case; 17th Aug 2012 at 11:56.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!