Skip to content

Instantly share code, notes, and snippets.

@ebraminio
Last active July 9, 2016 21:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ebraminio/3ff370da82f0e33b489752cc178cfcd0 to your computer and use it in GitHub Desktop.
Save ebraminio/3ff370da82f0e33b489752cc178cfcd0 to your computer and use it in GitHub Desktop.
Which fonts on Mac (10.11.5) have got "mort" or "morx" table?
mort morx Font Name
x /System/Library/Fonts/Apple Color Emoji.ttf
x /System/Library/Fonts/Apple Symbols.ttc
x /System/Library/Fonts/AppleSDGothicNeo.ttc
x /System/Library/Fonts/AquaKana.ttc
x /System/Library/Fonts/ArialHB.ttc
x /System/Library/Fonts/Courier.dfont
x /System/Library/Fonts/GeezaPro.ttc
x /System/Library/Fonts/Geneva.dfont
x /System/Library/Fonts/Helvetica.dfont
x /System/Library/Fonts/HelveticaNeue.dfont
x /System/Library/Fonts/HelveticaNeueDeskInterface.ttc
x /System/Library/Fonts/Keyboard.ttf
x /System/Library/Fonts/LucidaGrande.ttc
x /System/Library/Fonts/MarkerFelt.ttc
x /System/Library/Fonts/Menlo.ttc
x /System/Library/Fonts/Monaco.dfont
x /System/Library/Fonts/Optima.ttc
x /System/Library/Fonts/Palatino.ttc
x /System/Library/Fonts/STHeiti Light.ttc
x /System/Library/Fonts/STHeiti Medium.ttc
x /System/Library/Fonts/Symbol.ttf
x /System/Library/Fonts/Thonburi.ttc
x /System/Library/Fonts/Times.dfont
x /System/Library/Fonts/ZapfDingbats.ttf
x /System/Library/Fonts/ヒラギノ明朝 ProN W3.ttc
x /System/Library/Fonts/ヒラギノ明朝 ProN W6.ttc
x /Library/Fonts/Al Nile.ttc
x /Library/Fonts/Al Tarikh.ttc
x /Library/Fonts/AlBayan.ttc
x /Library/Fonts/AmericanTypewriter.ttc
x /Library/Fonts/Apple Chancery.ttf
x /Library/Fonts/AppleGothic.ttf
x /Library/Fonts/Athelas.ttc
x /Library/Fonts/Ayuthaya.ttf
x /Library/Fonts/Baghdad.ttc
x /Library/Fonts/Bangla MN.ttc
x /Library/Fonts/Bangla Sangam MN.ttc
x /Library/Fonts/Baskerville.ttc
x /Library/Fonts/Beirut.ttc
x /Library/Fonts/BigCaslon.ttf
x /Library/Fonts/Brush Script.ttf
x /Library/Fonts/Chalkboard.ttc
x /Library/Fonts/ChalkboardSE.ttc
x /Library/Fonts/Cochin.ttc
x /Library/Fonts/Copperplate.ttc
x /Library/Fonts/Corsiva.ttc
x /Library/Fonts/Damascus.ttc
x /Library/Fonts/DecoTypeNaskh.ttc
x /Library/Fonts/Devanagari Sangam MN.ttc
x /Library/Fonts/DevanagariMT.ttc
x /Library/Fonts/Didot.ttc
x /Library/Fonts/Diwan Kufi.ttc
x /Library/Fonts/Diwan Thuluth.ttf
x /Library/Fonts/Farah.ttc
x /Library/Fonts/Farisi.ttf
x /Library/Fonts/Futura.ttc
x /Library/Fonts/GillSans.ttc
x /Library/Fonts/Gujarati Sangam MN.ttc
x /Library/Fonts/GujaratiMT.ttc
x /Library/Fonts/Gungseouche.ttf
x /Library/Fonts/Gurmukhi MN.ttc
x /Library/Fonts/Gurmukhi Sangam MN.ttc
x /Library/Fonts/Gurmukhi.ttf
x /Library/Fonts/HeadlineA.ttf
x /Library/Fonts/Herculanum.ttf
x /Library/Fonts/Hoefler Text.ttc
x /Library/Fonts/InaiMathi.ttf
x /Library/Fonts/Kailasa.ttc
x /Library/Fonts/Kaiti.ttc
x /Library/Fonts/Kannada MN.ttc
x /Library/Fonts/Kannada Sangam MN.ttc
x /Library/Fonts/Kefa.ttc
x /Library/Fonts/Khmer MN.ttc
x /Library/Fonts/Khmer Sangam MN.ttf
x /Library/Fonts/Kokonor.ttf
x /Library/Fonts/Krungthep.ttf
x /Library/Fonts/KufiStandardGK.ttc
x /Library/Fonts/Lao MN.ttc
x /Library/Fonts/Lao Sangam MN.ttf
x /Library/Fonts/Malayalam MN.ttc
x /Library/Fonts/Malayalam Sangam MN.ttc
x /Library/Fonts/Marion.ttc
x /Library/Fonts/Mishafi Gold.ttf
x /Library/Fonts/Mishafi.ttf
x /Library/Fonts/Mshtakan.ttc
x /Library/Fonts/Muna.ttc
x /Library/Fonts/Myanmar MN.ttc
x /Library/Fonts/Myanmar Sangam MN.ttc
x /Library/Fonts/Nadeem.ttc
x /Library/Fonts/NewPeninimMT.ttc
x /Library/Fonts/Oriya MN.ttc
x /Library/Fonts/Oriya Sangam MN.ttc
x /Library/Fonts/Osaka.ttf
x /Library/Fonts/OsakaMono.ttf
x /Library/Fonts/Papyrus.ttc
x /Library/Fonts/PCmyoungjo.ttf
x /Library/Fonts/Pilgiche.ttf
x /Library/Fonts/PlantagenetCherokee.ttf
x /Library/Fonts/Raanana.ttc
x /Library/Fonts/Sana.ttc
x /Library/Fonts/Sathu.ttf
x /Library/Fonts/Silom.ttf
x /Library/Fonts/Sinhala MN.ttc
x /Library/Fonts/Sinhala Sangam MN.ttc
x /Library/Fonts/Skia.ttf
x /Library/Fonts/Tamil MN.ttc
x /Library/Fonts/Tamil Sangam MN.ttc
x /Library/Fonts/Telugu MN.ttc
x /Library/Fonts/Telugu Sangam MN.ttc
x /Library/Fonts/Trattatello.ttf
x /Library/Fonts/Waseem.ttc
x /Library/Fonts/Yuanti.ttc
x /Library/Fonts/Zapfino.ttf
x /Library/Fonts/ヒラギノ丸ゴ ProN W4.ttc
x /Library/Fonts/儷宋 Pro.ttf
x /Library/Fonts/儷黑 Pro.ttf
x /Library/Fonts/华文仿宋.ttf
x /Library/Fonts/华文细黑.ttf
x /Library/Fonts/华文黑体.ttf
#include <stdio.h>
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_GLYPH_H
#include <hb.h>
#include <hb-ft.h>
#include <dirent.h>
int main() {
FT_Library library;
FT_Init_FreeType(&library);
struct dirent *ent;
const char *path = "/System/Library/Fonts/";
// const char *path = "/Library/Fonts/";
DIR *dir = opendir(path);
if (dir == NULL) {
return 0;
}
while ((ent = readdir (dir)) != NULL) {
if (strcmp(ent->d_name, ".") == 0 || strcmp(ent->d_name, "..") == 0) continue;
if (strcmp(ent->d_name, "encodings.dir") == 0) continue;
if (strcmp(ent->d_name, "fonts.dir") == 0) continue;
if (strcmp(ent->d_name, "fonts.list") == 0) continue;
if (strcmp(ent->d_name, "fonts.scale") == 0) continue;
if (strcmp(ent->d_name, ".DS_Store") == 0) continue;
FT_Face face;
char fontFile[100] = {0};
strcat(fontFile, path);
strcat(fontFile, ent->d_name);
FT_New_Face(library, fontFile, 0, &face);
hb_font_t *hb_font;
hb_face_t *hb_face;
hb_font = hb_ft_font_create(face, NULL);
hb_face = hb_font_get_face(hb_font);
bool mort = false;
bool morx = false;
hb_blob_t *mort_blob = hb_face_reference_table(hb_face, hb_tag_from_string("mort", -1));
if (hb_blob_get_length(mort_blob)) {
mort = true;
hb_blob_destroy (mort_blob);
}
hb_blob_t *morx_blob = hb_face_reference_table(hb_face, hb_tag_from_string("morx", -1));
if (hb_blob_get_length(morx_blob)) {
morx = true;
hb_blob_destroy(morx_blob);
}
hb_font_destroy(hb_font);
FT_Done_Face(face);
if (mort || morx)
printf ("| %s | %s | %s |\n", mort ? "x" : " ", morx ? "x" : " ", fontFile);
}
closedir(dir);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment