diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-05-29 11:37:26 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2016-05-29 11:37:52 -0300 |
commit | 3e8eb396d7cfec8a96efb78719c0556f1beccf68 (patch) | |
tree | 3f6e9adbac4c20989812b338ca7bc3a0b65f568d /tools/SCsub | |
parent | a5777994cbc06183af7db7d8233434f245d5b089 (diff) |
Finalized DynamicFont implementation
-DynamicFont uses Freetype by default
-Editor fonts are now scalable thanks to this
-Cleaned up documentation browser and added fonts for this
Diffstat (limited to 'tools/SCsub')
-rw-r--r-- | tools/SCsub | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/tools/SCsub b/tools/SCsub index 2210538a25..7a0feb6e3d 100644 --- a/tools/SCsub +++ b/tools/SCsub @@ -58,7 +58,41 @@ def make_translations_header(target,source,env): g.write("#endif") +def make_fonts_header(target,source,env): + + dst = target[0].srcnode().abspath + + g = open(dst,"wb") + + + """" + """ + + g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n") + g.write("#ifndef _EDITOR_FONTS_H\n") + g.write("#define _EDITOR_FONTS_H\n") + + #saving uncompressed, since freetype will reference from memory pointer + xl_names=[] + for i in range(len(source)): + print("Appending font: "+source[i].srcnode().abspath) + f = open(source[i].srcnode().abspath,"rb") + buf = f.read() + import os.path + + name = os.path.splitext(os.path.basename(source[i].srcnode().abspath))[0] + + g.write("static const int _font_"+name+"_size="+str(len(buf))+";\n") + g.write("static const unsigned char _font_"+name+"[]={\n") + for i in range(len(buf)): + g.write(str(ord(buf[i]))+",\n") + + g.write("};\n") + + g.write("#endif") + + if (env["tools"]!="no"): import glob @@ -70,11 +104,18 @@ if (env["tools"]!="no"): env.Depends('#tools/editor/translations.h',tlist) env.Command('#tools/editor/translations.h',tlist,make_translations_header) + flist = glob.glob(dir + "/editor_fonts/*.ttf") + flist.append( glob.glob(dir + "/editor_fonts/*.otf") ) + + print("fonts: ",flist) + env.Depends('#tools/editor/builtin_fonts.h',flist) + env.Command('#tools/editor/builtin_fonts.h',flist,make_fonts_header) + SConscript('editor/SCsub'); #SConscript('scintilla/SCsub'); SConscript('collada/SCsub'); SConscript('docdump/SCsub'); - SConscript('freetype/SCsub'); + #SConscript('freetype/SCsub'); SConscript('doc/SCsub') SConscript('pck/SCsub') |