33# MIT License.
44
55# Copyright (c) 2016 William Skellenger
6- #
7- # Permission is hereby granted, free of charge, to any person obtaining a
8- # copy of this software and associated documentation files (the "Software"),
9- # to deal in the Software without restriction, including without limitation
10- # the rights to use, copy, modify, merge, publish, distribute, sublicense,
11- # and/or sell copies of the Software, and to permit persons to whom the
6+ #
7+ # Permission is hereby granted, free of charge, to any person obtaining a
8+ # copy of this software and associated documentation files (the "Software"),
9+ # to deal in the Software without restriction, including without limitation
10+ # the rights to use, copy, modify, merge, publish, distribute, sublicense,
11+ # and/or sell copies of the Software, and to permit persons to whom the
1212# Software is furnished to do so, subject to the following conditions:
13- #
14- # The above copyright notice and this permission notice shall be included
13+ #
14+ # The above copyright notice and this permission notice shall be included
1515# in all copies or substantial portions of the Software.
16- #
17- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18- # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22- # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
16+ #
17+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18+ # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22+ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2323# IN THE SOFTWARE.
2424
2525# This small script is designed to mostly take a BDF file and convert it to a
3232#
3333# Usage: bdf2adafruit.py <somefont.bdf> > out.txt
3434#
35- # Once you have out.txt you can cut/paste the contents into a new font
35+ # Once you have out.txt you can cut/paste the contents into a new font
3636# header file as part of the Adafruit GFX library.
3737
3838import sys
@@ -54,7 +54,7 @@ class Glyph:
5454 height = 0
5555 advance = 0
5656 xoffs = 0
57- yoffs = 0
57+ yoffs = 0
5858 def __init__ (self , comment ):
5959 self .comment = comment
6060 self .rows = []
@@ -107,7 +107,7 @@ def __init__(self, comment):
107107 #g.rows.append(int(line, 16)) #append pixel rows into glyph's list of rows
108108 bitmapData .append (int (line , 16 ))
109109
110- print
110+ print
111111
112112i = 0
113113for char in chars :
@@ -128,8 +128,8 @@ def __init__(self, comment):
128128 print ("\t /* 0x%02X %s */" % (char .encoding , char .comment ))
129129
130130for char in chars :
131- # offset, bit-width, bit-height, advance cursor, x offset, y offset
131+ # offset, bit-width, bit-height, advance cursor, x offset, y offset
132132 print ("\t { %d, %d, %d, %d, %d, %d }, /* 0x%02X %s */" % (
133- char .offset , char .width , char .height ,
134- char .advance , char .xoffs , char .yoffs ,
133+ char .offset , char .width , char .height ,
134+ char .advance , char .xoffs , char .yoffs ,
135135 char .encoding , char .comment ))
0 commit comments