Automatic text wrapping/text box filling
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
- #9639 par @RichardHopperProGrammar — fermée sans fusion
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 30/100
- Type d'issue
- Fonctionnalité
- Clarté
- À clarifier
- Activité
- Calme
- Stack technique
- python
- Domaine
- computer-graphics
Piste de recherche
Start with the existing draw_multiline_text and getsize APIs and compare the linked script for current wrapping behavior. Clarify which width, height, clipping, and font-size behaviors are in scope before coding; done should be a defined text-box API with the selected behaviors covered by tests.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
many people have written scripts to do this and it's relatively easy with the library's getsize func but I feel like it really should be a built-in feature.
i think there should be a draw_text_box or similar function which has these properties on top of the existing draw_multiline_text:
- you can specify a max width in pixels and Pillow will automatically insert line breaks to keep the text's width under the max width
- I think there should be an option to only break at word boundaries unless the word exceeds the max width, like the CSS word-break property
- you can specify a max height in pixels with one of two behaviors:
- when reaching the max height, the text box is clipped and doesn't draw any more.
- when reaching the max height, the font size is gradually reduced until the text fits inside
- I think a min font size property would be useful here
- also an option to find the biggest font size that fits within the text box
- a max font size property would be useful here
I'm not very experienced with the library internals or C in general so for now I won't make a pull, I just want to throw the idea out there to the devs
- Langage dominant
- Python
- Étoiles
- 14k
- Forks
- 2.6k
- Merge moyen
- 1 j 1 h
- PR mergées (30 j)
- 205
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de python-pillow/Pillow
-
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
python-pillow/Pillow#10590 ·
Les mainteneurs répondent en général sous 1 jour
-
Image.thumbnail() raises ZeroDivisionError when the target height is 0Peut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
python-pillow/Pillow#10589 ·
Les mainteneurs répondent en général sous 1 jour
-
Sun raster files with RLE encoding and odd-width rows decode shiftedPeut-être pris @PerryLink l’a pris il y a 21 jours. Ouverte🤖-assisted
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
python-pillow/Pillow#10370 · 3 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
Warn that pre-applying arabic_reshaper + python-bidi corrupts text on a Raqm buildPeut-être pris @Syamjith-NK l’a pris il y a 85 jours. OuverteDocumentation Font Rendering PNG Third Party Framework
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
python-pillow/Pillow#9907 · 3 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
Example code in ImageText documentation makes incorrect use of get_bbox()Peut-être pris @mmporong l’a pris il y a 1 jour. OuverteDocumentation
Difficulté 1/5 Moins d'une heure Accessibilité débutants 25/100
python-pillow/Pillow#10583 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de python-pillow/Pillow
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
vllm-project/vllm#69304 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
interpreter-core type-bug
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
Les mainteneurs répondent en général sous 1 jour
-
pydanty:is-working
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
pydantic/pydantic-ai#14187 ·
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
Les mainteneurs répondent en général sous 1 jour
-
test
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
prebid/salesagent#2676 ·
Les mainteneurs répondent en général sous 1 jour