Skip to content

Instantly share code, notes, and snippets.

View southwolf's full-sized avatar

SouthWolf southwolf

  • HSBC
  • Guangzhou, China
View GitHub Profile
# coding=utf-8
import Image, ImageDraw, ImageFont
import struct
font_width = 16
font = ImageFont.truetype("/usr/share/fonts/truetype/wqy/wqy-zenhei.ttc", font_width)
def get_font_data(char):
@southwolf
southwolf / font2pbm.rb
Created March 29, 2013 09:49
Pebble font resource to pbm(the most close format I can think of to the pebble res) converter **Faulty**
class Image
attr_accessor :width, :height, :bitmap
end
img = Image.new
hexmap = nil
File.open('font1', 'rb') do |f|
data = f.read
img.width = data[0].ord