Skip to content

Commit

Permalink
strip whitespaces, allow empty lines
Browse files Browse the repository at this point in the history
  • Loading branch information
tomchen committed Jan 7, 2025
1 parent 731bc5d commit 6e5ba11
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 6 deletions.
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,9 @@ trim_trailing_whitespace = true

[*.{md,mdx}]
trim_trailing_whitespace = false

[*.bdf]
charset = utf-8
end_of_line = lf
insert_final_newline = false
trim_trailing_whitespace = false
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- ubuntu-latest
- macos-latest
- windows-latest
python: ["3.5", "3.6", "3.7", "3.8", "3.9", "3.10"]
python: ["3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.13.1"]

steps:
- uses: actions/checkout@v2
Expand Down
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"python.testing.unittestEnabled": false,
"python.testing.nosetestsEnabled": false,
"python.testing.pytestEnabled": true,
"python.envFile": "${workspaceRoot}/vscode.env"
}
8 changes: 6 additions & 2 deletions src/bdfparser/bdfparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ def __parse_headers(self):

while 1:

line = next(self.__f)
line = next(self.__f).strip()
while len(line) == 0:
line = next(self.__f).strip()
kvlist = line.split(None, 1)
l = len(kvlist)

Expand Down Expand Up @@ -203,7 +205,9 @@ def __parse_props(self):

while 1:

line = next(self.__f)
line = next(self.__f).strip()
while len(line) == 0:
line = next(self.__f).strip()
kvlist = line.split(None, 1)
l = len(kvlist)

Expand Down
21 changes: 19 additions & 2 deletions tests/fonts/unifont-13.0.04-for-test.bdf
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
STARTFONT 2.1


STARTFONT 2.1

FONT -gnu-Unifont-Medium-R-Normal-Sans-16-160-75-75-c-80-iso10646-1
SIZE 16 75 75
FONTBOUNDINGBOX 16 16 0 -2
COMMENT "Generated by fontforge, http://fontforge.sourceforge.net"
COMMENT "(C)Copyright"
STARTPROPERTIES 24
COPYRIGHT "Copyright (C) 1998-2020 Roman Czyborra, Paul Hardy, Qianqian Fang, Andrew Miller, Johnnie Weaver, David Corbett, Rebecca Bettencourt, et al. License: SIL Open Font License version 1.1 and GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html> with the GNU Font Embedding Exception."


FONT_VERSION "13.0.04"
FONT_TYPE "Bitmap"
FOUNDRY "GNU"
Expand All @@ -30,7 +35,13 @@ FONT_ASCENT 14
FONT_DESCENT 2
DEFAULT_CHAR 65533
ENDPROPERTIES
CHARS 849






CHARS 849
STARTCHAR U+0001
ENCODING 1
SWIDTH 1000 0
Expand Down Expand Up @@ -19558,4 +19569,10 @@ BITMAP
4A
4A
ENDCHAR





ENDFONT

0 comments on commit 6e5ba11

Please sign in to comment.