diegomura / diegomura/react-pdf

I want to implement an auto fit feature

Open
#1,111 0 comments 1 reaction 0 assignees View on GitHub
new feature
Dominant language
TypeScript
Stars
16.8k
Forks
1.3k
Avg merge
5h 6m
Merged PRs (30d)
52

Description

Basically I have a template with a fixed width and height for the Text component and I want to reduce the fontSize when the size of the text gets bigger than the component, so the text always fits inside the Text component

For this I need a way to know the width and height that a text could have with an specific font size, but I don't see a way to get that, It looks like I can use te Canvas component instead of the Text component, I saw that pfdkit has a method called widthOfString that could help me with that, but is not available as part of the painter object in the Canvas, can we add it?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.