diff --git a/.editorconfig b/.editorconfig index d9de0c9..75bbdcb 100644 --- a/.editorconfig +++ b/.editorconfig @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 91100b4..8a66594 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,9 +8,9 @@ jobs: deploy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: "3.x" - name: Install dependencies diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 14bb199..029ec9d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,24 +16,25 @@ jobs: strategy: matrix: os: - - ubuntu-latest - - macos-latest + - ubuntu-20.04 - 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"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Setup Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} + env: + PIP_TRUSTED_HOST: "pypi.python.org pypi.org files.pythonhosted.org" - name: Install Tox and any other packages run: pip install tox - name: Run Tox # Run tox using the version of Python in `PATH` run: tox -e py - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 - if: matrix.os == 'ubuntu-latest' && matrix.python == '3.9' + uses: codecov/codecov-action@v5 + if: github.event_name == 'push' && matrix.os == 'ubuntu-20.04' && matrix.python == '3.13' with: file: ./coverage.xml diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 81002b9..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "python.testing.unittestEnabled": false, - "python.testing.nosetestsEnabled": false, - "python.testing.pytestEnabled": true, - "python.envFile": "${workspaceRoot}/vscode.env" -} diff --git a/src/bdfparser/bdfparser.py b/src/bdfparser/bdfparser.py index e325ddc..982e89c 100644 --- a/src/bdfparser/bdfparser.py +++ b/src/bdfparser/bdfparser.py @@ -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) @@ -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) diff --git a/tests/fonts/unifont-13.0.04-for-test.bdf b/tests/fonts/unifont-13.0.04-for-test.bdf index 2b59892..5ac13bf 100644 --- a/tests/fonts/unifont-13.0.04-for-test.bdf +++ b/tests/fonts/unifont-13.0.04-for-test.bdf @@ -1,4 +1,7 @@ -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 @@ -6,6 +9,8 @@ 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 with the GNU Font Embedding Exception." + + FONT_VERSION "13.0.04" FONT_TYPE "Bitmap" FOUNDRY "GNU" @@ -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 @@ -19558,4 +19569,10 @@ BITMAP 4A 4A ENDCHAR + + + + + ENDFONT + \ No newline at end of file diff --git a/tox.ini b/tox.ini index a5eac07..d531c0e 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] -envlist = py{35,36,37,38,39} +envlist = py35,py36,py37,py38,py39,py310,py311,py312,py313 minversion = 3.3.0 -isolated_build = true +isolated_build = True [testenv] deps = diff --git a/vscode.env b/vscode.env deleted file mode 100644 index 76297c2..0000000 --- a/vscode.env +++ /dev/null @@ -1 +0,0 @@ -PYTHONPATH=/;src/;${PYTHONPATH}