Skip to content

Commit

Permalink
inital commit
Browse files Browse the repository at this point in the history
  • Loading branch information
B3n30 committed Aug 14, 2017
0 parents commit 452655b
Show file tree
Hide file tree
Showing 9 changed files with 46,625 additions and 0 deletions.
Empty file added README.md
Empty file.
339 changes: 339 additions & 0 deletions license.txt

Large diffs are not rendered by default.

Binary file added shared_font/Montserrat-Regular.otf
Binary file not shown.
1,205 changes: 1,205 additions & 0 deletions shared_font/bcfnt.py

Large diffs are not rendered by default.

45,014 changes: 45,014 additions & 0 deletions shared_font/code_manifest.json

Large diffs are not rendered by default.

43 changes: 43 additions & 0 deletions shared_font/create_png.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import PIL.Image
import PIL.ImageDraw
import PIL.ImageFont

font = PIL.ImageFont.truetype("Montserrat-Regular.otf", 22)

chars=[]
with open('code_manifest.json','r') as f:
content = f.readlines()
for line in content[16:7495]:
line = line[line.find('"')+1:]
key = line[:line.find('"')]
if (key[0] == '\\' and len(key) == 6):
key = unichr(int(key[2:],16))
chars.append(key)

rows=1
cols=5
sheetCount = 1501
width=128
height=32

x_start_offset = 0
y_start_offset = 1
x_offset = 25
y_offset = 25

current_char = 0
for sheet in range(sheetCount):
img = PIL.Image.new("RGBA", (width, height))
draw = PIL.ImageDraw.Draw(img)
pos_y = y_start_offset
for row in range(rows):
pos_x = x_start_offset
for col in range(cols):
if (current_char < len(chars)):
draw.text((pos_x, pos_y), chars[current_char], "#FFF", font=font)
current_char += 1
if (current_char > 94):
font = PIL.ImageFont.truetype("unifont-10.0.05.ttf", 22)
pos_x += x_offset
pos_y += y_offset
img.save("code_sheet"+str(sheet)+".png","PNG")
4 changes: 4 additions & 0 deletions shared_font/ignore_3dstool.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// regex: ECMAScript grammar and case insensitive
//ignore:

//remap ignore:
20 changes: 20 additions & 0 deletions shared_font/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh

git clone --recursive https://github.com/dnasdw/3dstool
mkdir 3dstool/build
cd 3dstool/build
cmake ..
make
cd ../..
cp ignore_3dstool.txt 3dstool/bin/Release/
python create_png.py
python bcfnt.py -cf code.bcfnt
mkdir romfs
./3dstool/bin/Release/3dstool -zvf code.bcfnt --compress-type lzex --compress-out romfs/cbf_std.bcfnt.lz
./3dstool/bin/Release/3dstool -cvtf romfs romfs.bin --romfs-dir romfs
dd bs=4096 skip=1 if=romfs.bin of=00000000.app.romfs
rm -rf 3dstool
rm -rf romfs
rm code.bcfnt
rm code_sheet*
rm romfs.bin
Binary file added shared_font/unifont-10.0.05.ttf
Binary file not shown.

0 comments on commit 452655b

Please sign in to comment.