From b51e916812d48b71ff3196c8b1ff748bd9634e7f Mon Sep 17 00:00:00 2001 From: Mahmoud Lababidi Date: Mon, 25 Nov 2024 13:06:03 -0500 Subject: [PATCH 1/3] remove scrubbing of font name --- src/__init__.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/__init__.py b/src/__init__.py index 47689ccbf..55a103d1c 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -16548,17 +16548,18 @@ def __str__(self): ): continue - flags = JM_char_font_flags(mupdf.FzFont(mupdf.ll_fz_keep_font(ch.m_internal.font)), line, ch) + fz_font = mupdf.FzFont(mupdf.ll_fz_keep_font(ch.m_internal.font)) + flags = JM_char_font_flags(fz_font, line, ch) origin = mupdf.FzPoint(ch.m_internal.origin) style.size = ch.m_internal.size style.flags = flags - style.font = JM_font_name(mupdf.FzFont(mupdf.ll_fz_keep_font(ch.m_internal.font))) + style.font = fz_font if mupdf_version_tuple >= (1, 26): style.color = ch.m_internal.argb else: style.color = ch.m_internal.color - style.asc = JM_font_ascender(mupdf.FzFont(mupdf.ll_fz_keep_font(ch.m_internal.font))) - style.desc = JM_font_descender(mupdf.FzFont(mupdf.ll_fz_keep_font(ch.m_internal.font))) + style.asc = JM_font_ascender(fz_font) + style.desc = JM_font_descender(fz_font) if (style.size != old_style.size or style.flags != old_style.flags @@ -18736,7 +18737,7 @@ def jm_trace_text_span(dev, span, type_, ctm, colorspace, color, alpha, seqno): span = mupdf.FzTextSpan( span) assert isinstance( ctm, mupdf.fz_matrix) ctm = mupdf.FzMatrix( ctm) - fontname = JM_font_name( span.font()) + fontname = span.font() #float rgb[3]; #PyObject *chars = PyTuple_New(span->len); From b82ec5373e10b6650846ebe30f25d179b799c9c1 Mon Sep 17 00:00:00 2001 From: Mahmoud Lababidi Date: Mon, 25 Nov 2024 13:24:04 -0500 Subject: [PATCH 2/3] remove scrubbing of font name --- src/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/__init__.py b/src/__init__.py index 55a103d1c..e251bbf1b 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -16702,7 +16702,7 @@ def JM_make_textpage_dict(tp, page_dict, raw): block_list = [] tp_rect = mupdf.FzRect(tp.m_internal.mediabox) block_n = -1 - #log( 'JM_make_textpage_dict {=tp}') + # log( 'JM_make_textpage_dict {=tp}') for block in tp: block_n += 1 if (not mupdf.fz_contains_rect(tp_rect, mupdf.FzRect(block.m_internal.bbox)) From 90a765c3e963ea9445002089f137ca073a17ffd3 Mon Sep 17 00:00:00 2001 From: Mahmoud Lababidi Date: Mon, 25 Nov 2024 17:55:53 -0500 Subject: [PATCH 3/3] Create python-package-ubuntu.yml --- .github/workflows/python-package-ubuntu.yml | 44 +++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/python-package-ubuntu.yml diff --git a/.github/workflows/python-package-ubuntu.yml b/.github/workflows/python-package-ubuntu.yml new file mode 100644 index 000000000..a909d67aa --- /dev/null +++ b/.github/workflows/python-package-ubuntu.yml @@ -0,0 +1,44 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: Python package + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest # ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install flake8 pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + # - name: Lint with flake8 + # run: | + # # stop the build if there are Python syntax errors or undefined names + # flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + # flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + # - name: Test with pytest + # run: | + # pytest + - name: Build + +