Draw rounded ORCID badges in PDFs

This commit is contained in:
gloamxun committed 2026-10-19 21:25:31 +08:00
1 parent 5d6d51536f
commit e4c5b0cb32
5 files changed
+56 -11

No files matched your search

+7 -7
View File
@@ -68,13 +68,13 @@ the printpdf writer.
`orcid.pdf` is an image inside `\author`, but metadata currently keeps text
only. The title author-row renderer needs a positioned-image item that accepts an
x offset (the current `PositionedPageItem::Image` is pinned to x = 0) and a
small PNG/vector badge loaded from repository assets. The textual green `iD`
badge is the fallback until that image path exists. An inline
`PositionedPageItem::Badge` experiment with a 256 px PNG was reverted:
genpdf emitted a 12x12 px (about 0.5 mm) image regardless of
`Image::with_scale`, so the badge was invisible. The next attempt should
either vendor printpdf's image writer or draw a vector rounded rectangle
with a white iD instead of going through `genpdf::elements::Image`.
small PNG/vector badge loaded from repository assets. The current fallback is
`PositionedPageItem::Badge`: a native rounded polygon in the PDF (through the
vendored `genpdf::Area::fill_rounded_rect`) and a rounded `rect` in SVG, with a
white `iD` label. An earlier 256 px PNG experiment was reverted because genpdf
emitted a 12x12 px image regardless of `Image::with_scale`. Replacing the
polygon with the official ORCID bitmap still needs an image writer that keeps
the requested size and an x offset.
### First-page paragraph break
+3 -2
View File
@@ -108,8 +108,9 @@ See `docs/ROADMAP.md` for concrete implementation plans.
- Contents: chapter headings are listed with chapter-prefixed section
numbers, but contents are not split per chapter.
- Preprint title blocks: ORCID links in `\author` render as a native vector
badge (ORCID green square with a white iD) before the author name; the
original bitmap ORCID logo is not embedded.
badge (rounded ORCID-green polygon with a white iD, drawn natively in PDF
and SVG) before the author name; the original bitmap ORCID logo is not
embedded.
Hyperlinks use hyperref's green text colour; visible `\url` text emits a
PDF `/Link` URI annotation (`/Annots`). `\href`/ORCID-name labels still
carry only colour, because their target URL is not yet stored on the run.