figquilt 0.1.5__tar.gz → 0.1.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {figquilt-0.1.5 → figquilt-0.1.6}/PKG-INFO +1 -1
- {figquilt-0.1.5 → figquilt-0.1.6}/pyproject.toml +1 -1
- {figquilt-0.1.5 → figquilt-0.1.6}/src/figquilt/compose_pdf.py +3 -3
- {figquilt-0.1.5 → figquilt-0.1.6}/src/figquilt/compose_svg.py +3 -3
- {figquilt-0.1.5 → figquilt-0.1.6}/src/figquilt/layout.py +5 -3
- {figquilt-0.1.5 → figquilt-0.1.6}/src/figquilt/units.py +0 -5
- {figquilt-0.1.5 → figquilt-0.1.6}/README.md +0 -0
- {figquilt-0.1.5 → figquilt-0.1.6}/src/figquilt/__init__.py +0 -0
- {figquilt-0.1.5 → figquilt-0.1.6}/src/figquilt/cli.py +0 -0
- {figquilt-0.1.5 → figquilt-0.1.6}/src/figquilt/errors.py +0 -0
- {figquilt-0.1.5 → figquilt-0.1.6}/src/figquilt/grid.py +0 -0
- {figquilt-0.1.5 → figquilt-0.1.6}/src/figquilt/images.py +0 -0
- {figquilt-0.1.5 → figquilt-0.1.6}/src/figquilt/parser.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: figquilt
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.6
|
|
4
4
|
Summary: figquilt is a small, language-agnostic CLI tool that composes multiple figures (PDF/SVG/PNG) into a single publication-ready figure, based on a simple layout file (YAML/JSON). The key function is creating a PDF by composing multiple PDFs and adding subfigure labels and minimal annotations.
|
|
5
5
|
Author: YY Ahn
|
|
6
6
|
Author-email: YY Ahn <yongyeol@gmail.com>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "figquilt"
|
|
3
|
-
version = "0.1.
|
|
3
|
+
version = "0.1.6"
|
|
4
4
|
description = "figquilt is a small, language-agnostic CLI tool that composes multiple figures (PDF/SVG/PNG) into a single publication-ready figure, based on a simple layout file (YAML/JSON). The key function is creating a PDF by composing multiple PDFs and adding subfigure labels and minimal annotations."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
authors = [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fitz
|
|
2
2
|
from pathlib import Path
|
|
3
3
|
from .layout import Layout, Panel
|
|
4
|
-
from .units import
|
|
4
|
+
from .units import to_pt
|
|
5
5
|
from .errors import FigQuiltError
|
|
6
6
|
|
|
7
7
|
|
|
@@ -155,8 +155,8 @@ class PDFComposer:
|
|
|
155
155
|
# PyMuPDF insert_text uses 'baseline', so (0,0) is bottom-left of text char.
|
|
156
156
|
# We need to shift Y down by approximately the font sizing to match SVG visual.
|
|
157
157
|
|
|
158
|
-
pos_x = rect.x0 +
|
|
159
|
-
raw_y = rect.y0 +
|
|
158
|
+
pos_x = rect.x0 + to_pt(style.offset_x, self.units)
|
|
159
|
+
raw_y = rect.y0 + to_pt(style.offset_y, self.units)
|
|
160
160
|
|
|
161
161
|
# Approximate baseline shift: font_size
|
|
162
162
|
# (A more precise way uses font.ascender, but for basic standard fonts, size is decent proxy for visual top->baseline)
|
|
@@ -2,7 +2,7 @@ from pathlib import Path
|
|
|
2
2
|
import base64
|
|
3
3
|
from lxml import etree
|
|
4
4
|
from .layout import Layout, Panel
|
|
5
|
-
from .units import
|
|
5
|
+
from .units import to_pt
|
|
6
6
|
from .errors import FigQuiltError
|
|
7
7
|
import fitz
|
|
8
8
|
|
|
@@ -179,8 +179,8 @@ class SVGComposer:
|
|
|
179
179
|
text_str = text_str.upper()
|
|
180
180
|
|
|
181
181
|
# Offset relative to the content position
|
|
182
|
-
x = offset_x +
|
|
183
|
-
y = offset_y +
|
|
182
|
+
x = offset_x + to_pt(style.offset_x, self.units)
|
|
183
|
+
y = offset_y + to_pt(style.offset_y, self.units)
|
|
184
184
|
|
|
185
185
|
# Create text element
|
|
186
186
|
txt = etree.SubElement(parent, "text")
|
|
@@ -13,10 +13,12 @@ class LabelStyle(BaseModel):
|
|
|
13
13
|
auto_sequence: bool = Field(True, description="Auto-generate labels A, B, C...")
|
|
14
14
|
font_family: str = Field("Helvetica", description="Font family for labels")
|
|
15
15
|
font_size_pt: float = Field(8.0, description="Font size in points")
|
|
16
|
-
|
|
17
|
-
2.0, description="Horizontal offset from panel edge (
|
|
16
|
+
offset_x: float = Field(
|
|
17
|
+
2.0, description="Horizontal offset from panel edge (in page units)"
|
|
18
|
+
)
|
|
19
|
+
offset_y: float = Field(
|
|
20
|
+
2.0, description="Vertical offset from panel edge (in page units)"
|
|
18
21
|
)
|
|
19
|
-
offset_y_mm: float = Field(2.0, description="Vertical offset from panel edge (mm)")
|
|
20
22
|
bold: bool = Field(True, description="Use bold font")
|
|
21
23
|
uppercase: bool = Field(True, description="Use uppercase letters")
|
|
22
24
|
|
|
@@ -3,11 +3,6 @@ def mm_to_pt(mm: float) -> float:
|
|
|
3
3
|
return mm * 72 / 25.4
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
def pt_to_mm(pt: float) -> float:
|
|
7
|
-
"""Converts points to millimeters."""
|
|
8
|
-
return pt * 25.4 / 72
|
|
9
|
-
|
|
10
|
-
|
|
11
6
|
def inches_to_pt(inches: float) -> float:
|
|
12
7
|
"""Converts inches to points (1 inch = 72 pts)."""
|
|
13
8
|
return inches * 72
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|