Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add text outline/stroke option #52

Merged
merged 2 commits into from
Apr 24, 2024

Conversation

alexbrazier
Copy link

@alexbrazier alexbrazier commented Apr 22, 2024

What?

Added more text rendering options to add text stroke

page5.drawText('This text is outlined', {
  x: 30,
  y: 80,
  font: helveticaFont,
  color: hotPink,
  strokeColor: blue,
  strokeWidth: 1.5,
  renderMode: TextRenderingMode.FillAndOutline,
});

page5.drawText('Outline only', {
  x: 30,
  y: 10,
  font: helveticaFont,
  strokeColor: hotPink,
  strokeWidth: 1.5,
  renderMode: TextRenderingMode.Outline,
});

Why?

Issues like this: Hopding#763

Used manually on https://github.com/squareda/pdf-print-marks/blob/main/src/addMetadata.ts#L16 to add outlined text so it's more visible on unknown backgrounds

How?

Testing?

Added test to render some outlined text

New Dependencies?

No

Screenshots

image

Suggested Reading?

Yes

Anything Else?

Checklist

  • I read CONTRIBUTING.md.
  • I read MAINTAINERSHIP.md#pull-requests.
  • I added/updated unit tests for my changes.
  • I added/updated integration tests for my changes.
  • I ran the integration tests.
  • I tested my changes in Node, Deno, and the browser.
  • I viewed documents produced with my changes in Adobe Acrobat, Foxit Reader, Firefox, and Chrome.
  • I added/updated doc comments for any new/modified public APIs.
  • My changes work for both new and existing PDF files.
  • I ran the linter on my changes.

@Sharcoux Sharcoux merged commit 7c5a6ec into cantoo-scribe:master Apr 24, 2024
1 check passed
@Sharcoux
Copy link
Collaborator

Released in v1.21.1

Thanks a lot for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants