compile-unifont.py revision 86db5dfb6d334e583ea4161191754522ce850eed
# -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */
#
# This file is part of systemd.
#
# Copyright 2013-2014 David Herrmann <dh.herrmann@gmail.com>
#
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# systemd is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
#
# Parse a unifont.hex file and produce a compressed binary-format.
#
from __future__ import print_function
import re
import sys
import fileinput
import struct
#
# Write "bits" array as binary output.
#
def write_bin_entry(entry):
if l != 32 and l != 64:
l = 0
elif l < 64:
i = 0
if l <= k * 16 * 2:
c = 0
else:
i += 2
# write glyphs
#
# Parse hex file into "bits" array
#
if m == None:
return
# insert skipped lines
def parse_hex():
bits = []
if not line:
continue
continue
return bits
#
# In normal mode we simply read line by line from standard-input and write the
# binary-file to standard-output.
#
if __name__ == "__main__":