Python3
Puisque personne n'a vraiment abordé la partie qui spécifie pour C++, Python, Ruby ou Perl, voici la méthode Python3. J'ai essayé d'être descriptif, mais vous pouvez simplifier pour travailler comme vous en avez besoin.
Exigences :PIL (Oreiller)
Module ImageDraw et ImageFont de PIL
# pip install Pillow
from PIL import Image, ImageFont, ImageDraw
# use a truetype font (.ttf)
# font file from fonts.google.com (https://fonts.google.com/specimen/Courier+Prime?query=courier)
font_path = "fonts/Courier Prime/"
font_name = "CourierPrime-Regular.ttf"
out_path = font_path
font_size = 16 # px
font_color = "#000000" # HEX Black
# Create Font using PIL
font = ImageFont.truetype(font_path+font_name, font_size)
# Copy Desired Characters from Google Fonts Page and Paste into variable
desired_characters = "ABCČĆDĐEFGHIJKLMNOPQRSŠTUVWXYZŽabcčćdđefghijklmnopqrsštuvwxyzž1234567890‘?’“!”(%)[#]{@}/&\<-+÷×=>®©$€£¥¢:;,.*"
# Loop through the characters needed and save to desired location
for character in desired_characters:
    
    # Get text size of character
    width, height = font.getsize(character)
    
    # Create PNG Image with that size
    img = Image.new("RGBA", (width, height))
    draw = ImageDraw.Draw(img)
    
    # Draw the character
    draw.text((-2, 0), str(character), font=font, fill=font_color)
    
    # Save the character as png
    try:
        img.save(out_path + str(ord(character)) + ".png")
    except:
        print(f"[-] Couldn't Save:\t{character}")
 wget http://sid.ethz.ch/debian/ttf2png/ttf2png-0.3.tar.gz
tar xvzf ttf2png-0.3.tar.gz
cd ttf2png-0.3 && make
./ttf2png ttf2png -l 11 -s 18 -e -o test.png /path/to/your/font.ttf
eog test.png&
 probablement en partie dupliqué Comment puis-je convertir gratuitement des glyphes TTF en fichiers .png sur Mac ?
imagemagick peut répondre à ce type de demandes, devrait fonctionner correctement sur Mac/Linux/Windows. :-)
convert -background none -fill black -font font.ttf -pointsize 300 label:"Z" z.png
 si une conversion par lots est nécessaire, vous pouvez peut-être envisager d'utiliser un petit script ruby appelé ttf2png .
Le PIL fournit une API pour cela, mais elle est facile à utiliser. Une fois que vous avez l'image PIL, vous pouvez l'exporter.