Automatic text wrapping/text box filling
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
- #9639 von @RichardHopperProGrammar — ohne Merge geschlossen
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 30/100
- Issue-Typ
- Feature
- Klarheit
- Muss geklärt werden
- Aktivitätsstatus
- Ruhig
- Tech-Stack
- python
- Bereich
- computer-graphics
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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
- Vorherrschende Sprache
- Python
- Sterne
- 14k
- Forks
- 2.6k
- Ø Merge
- 1 T. 1 Std.
- Gemergte PRs (30 T.)
- 205
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus python-pillow/Pillow
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
python-pillow/Pillow#10590 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Image.thumbnail() raises ZeroDivisionError when the target height is 0Evtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
python-pillow/Pillow#10589 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Sun raster files with RLE encoding and odd-width rows decode shiftedEvtl. vergeben @PerryLink hat das vor 21 Tagen übernommen. Offen🤖-assisted
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
python-pillow/Pillow#10370 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Warn that pre-applying arabic_reshaper + python-bidi corrupts text on a Raqm buildEvtl. vergeben @Syamjith-NK hat das vor 85 Tagen übernommen. OffenDocumentation Font Rendering PNG Third Party Framework
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
python-pillow/Pillow#9907 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Example code in ImageText documentation makes incorrect use of get_bbox()Evtl. vergeben @mmporong hat das vor 1 Tag übernommen. OffenDocumentation
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 25/100
python-pillow/Pillow#10583 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in python-pillow/Pillow
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
vllm-project/vllm#69304 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
interpreter-core type-bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
Maintainer antworten meist innerhalb von 1 Tag
-
pydanty:is-working
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
pydantic/pydantic-ai#14187 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
Maintainer antworten meist innerhalb von 1 Tag
-
test
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
prebid/salesagent#2676 ·
Maintainer antworten meist innerhalb von 1 Tag