idml 0.8.0 → 0.8.1
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.
- checksums.yaml +4 -4
- data/TODO.pdf/115-bullet-numbered-lists.md +5 -4
- data/lib/idml/render/style_resolver.rb +16 -1
- data/lib/idml/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 987636748becfcad9dafe0f703801848e6c4e1bffa12a59b7cd0034424b3628a
|
|
4
|
+
data.tar.gz: bcd103a17bab68ca38a9cd2534aa97f937aa10f560c79283bd5e1efd585be22e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d7eb62a48b163312832120f0d475b4b7ced9b1364c457677135026f1e75b84d36d53faa834c7ec36ecd87b4e9daacd727c0f1e75639a87919b98f507c56fde01
|
|
7
|
+
data.tar.gz: 470a0a62f1855b42369f0a81f099982a89a50f4070ad981a23d66693f6724e3fdf8c04441fb274c702871163e94c96804a27b4d7651ec5eea5de83cd435c791d
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
# TODO PDF 115: Bullet and numbered list rendering
|
|
2
2
|
|
|
3
|
-
## Status: DONE
|
|
4
|
-
(
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
## Status: DONE — markers are prepended inline AND a hanging indent
|
|
4
|
+
(18pt) is applied so wrapped lines align with text after the marker.
|
|
5
|
+
The indent is approximate (fixed width) since tab-stop measurement
|
|
6
|
+
requires font metrics at style-resolution time; future refinement
|
|
7
|
+
would measure the actual marker width.
|
|
7
8
|
|
|
8
9
|
## Problem
|
|
9
10
|
|
|
@@ -249,9 +249,12 @@ module Idml
|
|
|
249
249
|
end
|
|
250
250
|
private_class_method :alignment_for
|
|
251
251
|
|
|
252
|
+
HANGING_INDENT_WIDTH = 18.0
|
|
253
|
+
|
|
252
254
|
# Prepends the list marker (bullet glyph or numbered expression)
|
|
253
255
|
# to the paragraph's first run when the paragraph is part of
|
|
254
|
-
# a list.
|
|
256
|
+
# a list. Also applies a hanging indent so wrapped lines align
|
|
257
|
+
# with the text after the marker, not with the marker itself.
|
|
255
258
|
def self.prepend_list_marker(paragraph)
|
|
256
259
|
marker = ListMarker.marker_for(paragraph)
|
|
257
260
|
return unless marker
|
|
@@ -259,9 +262,21 @@ module Idml
|
|
|
259
262
|
|
|
260
263
|
first_run = paragraph.runs.first
|
|
261
264
|
first_run.text = "#{marker}#{first_run.text}"
|
|
265
|
+
apply_hanging_indent(paragraph)
|
|
262
266
|
end
|
|
263
267
|
private_class_method :prepend_list_marker
|
|
264
268
|
|
|
269
|
+
# Adjusts left_indent and first_line_indent for a hanging
|
|
270
|
+
# indent effect: first line starts at the original left edge
|
|
271
|
+
# (with the marker), wrapped lines indent by HANGING_INDENT_WIDTH.
|
|
272
|
+
def self.apply_hanging_indent(paragraph)
|
|
273
|
+
current_left = paragraph.left_indent || 0
|
|
274
|
+
current_first = paragraph.first_line_indent || 0
|
|
275
|
+
paragraph.left_indent = current_left + HANGING_INDENT_WIDTH
|
|
276
|
+
paragraph.first_line_indent = current_first - HANGING_INDENT_WIDTH
|
|
277
|
+
end
|
|
278
|
+
private_class_method :apply_hanging_indent
|
|
279
|
+
|
|
265
280
|
# Concatenate runs into a single block. Used when the renderer
|
|
266
281
|
# can't handle per-run styling (e.g., no font metrics available).
|
|
267
282
|
def self.concatenate(runs)
|
data/lib/idml/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: idml
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.8.
|
|
4
|
+
version: 0.8.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-08-
|
|
11
|
+
date: 2026-08-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bigdecimal
|