55

How can I change a font name (not the ttf filename, but the actual font name)?

For example, I want to rename "Tahoma" to "Tahoma7".

My goal is to rename the Tahoma font installed on Windows 7 and install it on Windows XP under different name, so I will have both Tahoma fonts installed on a single operating system. The two fonts are slightly different, and I'd like to have them both.

RubyWedge
  • 681

8 Answers8

32

FontForge may be of use:

FontForge -- An outline font editor that lets you create your own postscript, truetype, opentype, cid-keyed, multi-master, cff, svg and bitmap (bdf, FON, NFNT) fonts, or edit existing ones. Also lets you convert one format to another. FontForge has support for many macintosh font formats.

Shevek
  • 16,738
20

TTX is a command line tool and can be make it pretty simple to change a font's name. There's a tutorial on how to do exactly that here: http://www.fontgeek.net/blog/?p=343

Download TTX as part of fonttools

-

Updated Answer

To rename the internal font name of a TrueType font (.ttf) without installing GUI-based third-party software, you can use Python and the fonttools library.

  1. Install fonttools:

    pip install fonttools
    
  2. Create a Python Script: Create a script named rename_font.py:

    cat <<EOF > rename_font.py
    from fontTools.ttLib import TTFont
    import sys
    

    def rename_font(input_path, output_path, new_name): font = TTFont(input_path) for record in font['name'].names: if record.nameID in [1, 4, 6]: # Family name, Full name, PostScript name record.string = new_name.encode(record.getEncoding()) font.save(output_path)

    if name == "main": if len(sys.argv) != 4: print("Usage: rename_font.py <input_path> <output_path> <new_name>") sys.exit(1) rename_font(sys.argv[1], sys.argv[2], sys.argv[3]) EOF

Example Usage

python rename_font.py Tahoma.ttf Tahoma7.ttf "Tahoma7"
davidcondrey
  • 1,748
6

You can use Typograf for that.

Navigate to the folder where font is located, select .ttf file, click Properties. Properties window will appear:

enter image description here

Change font names (font family, full name, Postscript name etc) as required and click "Save as..." button.

3

Per this answer on StackOverflow:

  • Import your font file in the online Glyphrstudio font editor
  • Click the hamburger icon on the top left
  • Select font setting and change title and meta data from there
Steven Pease
  • 159
  • 1
  • 7
2
  1. Download and install FontForge.
  2. Right-click and “Run as Administrator” on this installation file.
  3. Click through the prompts and install a shortcut on your desktop.
  4. To run FontForge, right click on the shortcut and select “Run as Administrator.”
  5. Find the font you want to edit, highlight it, and click “OK.”
  6. Click Element > Font Info
  7. Change the Font Name, Family Name, and Name For Humans as needed
    • Font Name should be: FamilyNameVariationName-Weight. For example: EncodeSansCondensed-ExtraBold or DMSans36pt-ExtraLight. If there is no Variation: AlegreyaSans-SemiBold.
    • Family Name should be the main name with no modifiers. For example, the Family Name of CrimsonDisplay-LightItalic, CrimsonDisplay-Black, and CrimsonText-Regular is Crimson.
    • Name for Humans should be the same as Font Name.
  8. Click “Ok” after making those changes.
  9. To save it, go to File > Generate Fonts.
  10. Select the folder you’d like to save it to.
  11. Select TrueType from the dropdown and click “Generate.”
  12. You may get some errors. If you are knowledgeable about fonts and FontForge, correct them if you’d like. Otherwise, simple press “Generate” to continue.
  13. The new TTF file will appear in the directory you saved it in. You may close FontForge without saving the SFD file.
149203
  • 21
0

The fastest way is to use a Python script to edit the .ttf files. This script here prepends, appends, or renames the font filename, the font name, and doesn't rename font files that have already been renamed. Use pip install fontTools and then run the script python rename_fonts.py inside the directory with font files. ctrl-f "Free", make your edits, and then batch rename all files in the directory where the script is.

# Example Usage
# python rename_font.py
# rename all .ttf font files in this directory and sub-directories to "Free {original name}" and the font name to "Free {og name}"

import os import sys from fontTools.ttLib import TTFont

def rename_font(input_path): filename = os.path.basename(input_path) dirname = os.path.dirname(input_path)

if filename.startswith("Free "): print(f"Skipping already renamed font: {filename}") return

font = TTFont(input_path) name_ids_to_update = [1, 4, 6, 16, 17] # Update key name IDs

original_name = None for record in font["name"].names: if record.nameID == 1: # Family Name try: encoding = "utf-16-be" if record.platformID == 3 else record.getEncoding() original_name = record.string.decode(encoding) break except Exception: continue

if not original_name: original_name = os.path.splitext(filename)[0]

if original_name.startswith("Free"): new_filename = f"Free {filename}" new_path = os.path.join(dirname, new_filename) os.rename(input_path, new_path) print(f"Renamed file to match font name: {new_filename}") return # Skip further processing

new_name = f"Free {original_name}" # Prepend "Free"

for record in font["name"].names: if record.nameID in name_ids_to_update: try: encoding = "utf-16-be" if record.platformID == 3 else record.getEncoding() record.string = new_name.encode(encoding) except Exception as e: print(f"Error updating nameID {record.nameID} for {input_path}: {e}") output_path = os.path.join(dirname, f"Free {filename}") font.save(output_path) print(f"Renamed font saved as: {output_path}")

def find_and_rename_fonts(directory): for root, _, files in os.walk(directory): for file in files: if file.lower().endswith(".ttf"): font_path = os.path.join(root, file) rename_font(font_path)

if name == "main": target_directory = sys.argv[1] if len(sys.argv) > 1 else "." find_and_rename_fonts(target_directory)

djd
  • 1
-3

Microsoft Windows's Font properties editor is free and available at www.microsoft.com (no DKIM).

It will do the job.

mate64
  • 175
-4

It does not appear you can do this. I opened the tahoma.ttf file in a hex editor and the version information (including the font family name) is encrypted with something from VeriSign, Inc., specifically VeriSign Time Stamping Services CA. I see the files are different versions, but I can't visually see any difference.

Beaner
  • 3,707