Skip to content

Commit

Permalink
Merge pull request #431 from tannerhelland/text-tool-improvements
Browse files Browse the repository at this point in the history
Advanced Text tool improvements and new features.

Solves #428 . Many thanks to @0lm for submitting a detailed feature request!

This pull request adds the following features to the advanced text tool.

+    Justified text alignment. Most photo editors do not expose this feature because it's complicated to implement, and native text renderers frequently do not support this at a library level. (For example, Windows provides no native way to draw justified text, whether via GDI or GDI+. [DirectWrite finally supported this in Windows 8](https://docs.microsoft.com/en-us/windows/win32/directwrite/justification--kerning--and-spacing), but alas that doesn't help me in PhotoDemon since I need to support XP/Vista/7, too!)

Anyway, long story short is that PhotoDemon's justified alignment is implemented manually. Please let me know if you encounter any oddities.

+    Justified text alignment supports multiple paragraphs in a single text layer, with custom control over last-line (trailing) behavior. Trailing line behavior has its own justification setting and it can be left/center/right/jully justified independent of the paragraph as a whole.

+    Text fill and outline can now rendered in either order (outline above fill, or fill above outline).

+    A new "smooth" antialias setting is now exposed, in additional to the previous "none", "normal", "crisp" settings. Note that Photoshop exposes an additional "strong" setting, but PhotoDemon's settings do not map 1:1 to Photoshop's by design, because PD exposes hinting as its own property (whereas Photoshop mixes that into its antialiasing settings). So if you're trying to match Photoshop settings - which alas is not 100% possible due to underlying font rendering differences - remember to play with both antialiasing AND hinting to achieve the look you want.
  • Loading branch information
tannerhelland authored Sep 13, 2022
2 parents d7841da + 9af6b65 commit 90eb363
Show file tree
Hide file tree
Showing 31 changed files with 806 additions and 199 deletions.
24 changes: 17 additions & 7 deletions App/PhotoDemon/Languages/French.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<langid>fr-FR</langid>
<langname>Français</langname>
<langversion>6.7.592</langversion>
<langversion>6.7.594</langversion>
<langstatus>Complete</langstatus>

<author>Jean Jacques Piedfort (orig. Frank Donckers)</author>
Expand Down Expand Up @@ -3030,6 +3030,16 @@ Description: %2
<translation>reflection</translation>
</phrase>

<phrase>
<original>last line justify</original>
<translation></translation>
</phrase>

<phrase>
<original>outline on top</original>
<translation></translation>
</phrase>

<phrase>
<original>Modify selection</original>
<translation>Modification de la sélection</translation>
Expand All @@ -3052,7 +3062,7 @@ When finished, click the Submit New Issue button. Thank you!</original>
<translation>Instructions pour les rapports de bogues</translation>
</phrase>

<!-- Processor.bas contains 128 phrases. 68 were duplicates of existing phrases, so only 60 new phrases were written to file. -->
<!-- Processor.bas contains 132 phrases. 70 were duplicates of existing phrases, so only 62 new phrases were written to file. -->

<phrase>
<original>automatic</original>
Expand Down Expand Up @@ -12705,7 +12715,7 @@ Vous pouvez alors si besoin
<translation>Cliquer ici pour convertir en calque de texte avancé</translation>
</phrase>

<!-- Toolpanel_Typography.frm contains 60 phrases. 35 were duplicates of existing phrases, so only 25 new phrases were written to file. -->
<!-- Toolpanel_Typography.frm contains 64 phrases. 39 were duplicates of existing phrases, so only 25 new phrases were written to file. -->

<phrase>
<original>click here for detailed instructions (in English)</original>
Expand Down Expand Up @@ -13966,10 +13976,10 @@ Si vous choisissez de désactiver les mises à jour, n'oubliez pas de visiter ph

<!-- Automatic text generation complete. -->

<phrasecount>2640</phrasecount>
<phrasecount>2642</phrasecount>

<!-- As of this build, PhotoDemon contains 5515 phrases. -->
<!-- 2875 are duplicates, so only 2640 unique phrases have been written to file. -->
<!-- These 2640 phrases contain approximately 11421 total words. -->
<!-- As of this build, PhotoDemon contains 5523 phrases. -->
<!-- 2881 are duplicates, so only 2642 unique phrases have been written to file. -->
<!-- These 2642 phrases contain approximately 11427 total words. -->

</pdData>
24 changes: 17 additions & 7 deletions App/PhotoDemon/Languages/German.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<langid>de-DE</langid>
<langname>Deutsch (German)</langname>
<langversion>9.0</langversion>
<langversion>9.0.1</langversion>
<langstatus>Up-to-date</langstatus>

<author>rk (ehem. Frank Donckers, Helmut Kuerbiss)</author>
Expand Down Expand Up @@ -3030,6 +3030,16 @@ Deskription: %2
<translation>Spiegelung</translation>
</phrase>

<phrase>
<original>last line justify</original>
<translation></translation>
</phrase>

<phrase>
<original>outline on top</original>
<translation></translation>
</phrase>

<phrase>
<original>Modify selection</original>
<translation>Auswahl modifizieren</translation>
Expand All @@ -3054,7 +3064,7 @@ Nach Abschluss klicken Sie auf den Button "Neues Problem einreichen". Danke!</tr
<translation>Bug-Bericht-Instruktionen</translation>
</phrase>

<!-- Processor.bas contains 128 phrases. 68 were duplicates of existing phrases, so only 60 new phrases were written to file. -->
<!-- Processor.bas contains 132 phrases. 70 were duplicates of existing phrases, so only 62 new phrases were written to file. -->

<phrase>
<original>automatic</original>
Expand Down Expand Up @@ -12699,7 +12709,7 @@ Möchten Sie Ihre Batchliste vor dem Beenden speichern?</translation>
<translation>Klicken Sie hier, um diesen Layer in erweiterten Text zu konvertieren.</translation>
</phrase>

<!-- Toolpanel_Typography.frm contains 60 phrases. 35 were duplicates of existing phrases, so only 25 new phrases were written to file. -->
<!-- Toolpanel_Typography.frm contains 64 phrases. 39 were duplicates of existing phrases, so only 25 new phrases were written to file. -->

<phrase>
<original>click here for detailed instructions (in English)</original>
Expand Down Expand Up @@ -13955,10 +13965,10 @@ Wenn Sie sich dennoch dafür entscheiden, Updates zu deaktivieren, vergessen Sie

<!-- Automatic text generation complete. -->

<phrasecount>2640</phrasecount>
<phrasecount>2642</phrasecount>

<!-- As of this build, PhotoDemon contains 5515 phrases. -->
<!-- 2875 are duplicates, so only 2640 unique phrases have been written to file. -->
<!-- These 2640 phrases contain approximately 11421 total words. -->
<!-- As of this build, PhotoDemon contains 5523 phrases. -->
<!-- 2881 are duplicates, so only 2642 unique phrases have been written to file. -->
<!-- These 2642 phrases contain approximately 11427 total words. -->

</pdData>
24 changes: 17 additions & 7 deletions App/PhotoDemon/Languages/Indonesian.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<langid>indo-ID</langid>
<langname>Indonesian</langname>
<langversion>8.9.1699</langversion>
<langversion>8.9.1701</langversion>
<langstatus>90% complete</langstatus>

<author>Ari Sohandri Putra</author>
Expand Down Expand Up @@ -3021,6 +3021,16 @@ Deskripsi: %2
<translation></translation>
</phrase>

<phrase>
<original>last line justify</original>
<translation></translation>
</phrase>

<phrase>
<original>outline on top</original>
<translation></translation>
</phrase>

<phrase>
<original>Modify selection</original>
<translation></translation>
Expand All @@ -3043,7 +3053,7 @@ When finished, click the Submit New Issue button. Thank you!</original>
<translation>Intruksi Laporan Bug</translation>
</phrase>

<!-- Processor.bas contains 128 phrases. 68 were duplicates of existing phrases, so only 60 new phrases were written to file. -->
<!-- Processor.bas contains 132 phrases. 70 were duplicates of existing phrases, so only 62 new phrases were written to file. -->

<phrase>
<original>automatic</original>
Expand Down Expand Up @@ -12685,7 +12695,7 @@ Would kemudian anda suka untuk menyimpan senarai kumpulan anda sebelum keluar?</
<translation></translation>
</phrase>

<!-- Toolpanel_Typography.frm contains 60 phrases. 35 were duplicates of existing phrases, so only 25 new phrases were written to file. -->
<!-- Toolpanel_Typography.frm contains 64 phrases. 39 were duplicates of existing phrases, so only 25 new phrases were written to file. -->

<phrase>
<original>click here for detailed instructions (in English)</original>
Expand Down Expand Up @@ -13937,10 +13947,10 @@ Jika anda masih memilih untuk melumpuhkan Perbarui, jangan lupa untuk mengunjung

<!-- Automatic text generation complete. -->

<phrasecount>2640</phrasecount>
<phrasecount>2642</phrasecount>

<!-- As of this build, PhotoDemon contains 5515 phrases. -->
<!-- 2875 are duplicates, so only 2640 unique phrases have been written to file. -->
<!-- These 2640 phrases contain approximately 11421 total words. -->
<!-- As of this build, PhotoDemon contains 5523 phrases. -->
<!-- 2881 are duplicates, so only 2642 unique phrases have been written to file. -->
<!-- These 2642 phrases contain approximately 11427 total words. -->

</pdData>
24 changes: 17 additions & 7 deletions App/PhotoDemon/Languages/Italian.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<langid>it-IT</langid>
<langname>Italiano</langname>
<langversion>8.9.1607</langversion>
<langversion>8.9.1609</langversion>
<langstatus>Completa</langstatus>

<author>GioRock, ManfroMarce</author>
Expand Down Expand Up @@ -3029,6 +3029,16 @@ Descrizione: %2
<translation>mirroring</translation>
</phrase>

<phrase>
<original>last line justify</original>
<translation></translation>
</phrase>

<phrase>
<original>outline on top</original>
<translation></translation>
</phrase>

<phrase>
<original>Modify selection</original>
<translation>Modificare la selezione</translation>
Expand All @@ -3053,7 +3063,7 @@ When finished, click the Submit New Issue button. Thank you!</original>
<translation>Istruzioni per la segnalazione di bug</translation>
</phrase>

<!-- Processor.bas contains 128 phrases. 68 were duplicates of existing phrases, so only 60 new phrases were written to file. -->
<!-- Processor.bas contains 132 phrases. 70 were duplicates of existing phrases, so only 62 new phrases were written to file. -->

<phrase>
<original>automatic</original>
Expand Down Expand Up @@ -12708,7 +12718,7 @@ Vuoi salvare la tua lista prima di uscire?</translation>
<translation>Clicca qui per convertire questo livello in testo avanzato.</translation>
</phrase>

<!-- Toolpanel_Typography.frm contains 60 phrases. 35 were duplicates of existing phrases, so only 25 new phrases were written to file. -->
<!-- Toolpanel_Typography.frm contains 64 phrases. 39 were duplicates of existing phrases, so only 25 new phrases were written to file. -->

<phrase>
<original>click here for detailed instructions (in English)</original>
Expand Down Expand Up @@ -13964,10 +13974,10 @@ Se si sceglie comunque di disabilitare gli aggiornamenti, non dimenticate di vis

<!-- Automatic text generation complete. -->

<phrasecount>2640</phrasecount>
<phrasecount>2642</phrasecount>

<!-- As of this build, PhotoDemon contains 5515 phrases. -->
<!-- 2875 are duplicates, so only 2640 unique phrases have been written to file. -->
<!-- These 2640 phrases contain approximately 11421 total words. -->
<!-- As of this build, PhotoDemon contains 5523 phrases. -->
<!-- 2881 are duplicates, so only 2642 unique phrases have been written to file. -->
<!-- These 2642 phrases contain approximately 11427 total words. -->

</pdData>
24 changes: 17 additions & 7 deletions App/PhotoDemon/Languages/Macedonian.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<langid>mk-MK</langid>
<langname>Македонски</langname>
<langversion>8.9.1701</langversion>
<langversion>8.9.1703</langversion>
<langstatus>80% complete</langstatus>

<author>Бобан Ѓерасимоски</author>
Expand Down Expand Up @@ -3025,6 +3025,16 @@ Error број %
<translation></translation>
</phrase>

<phrase>
<original>last line justify</original>
<translation></translation>
</phrase>

<phrase>
<original>outline on top</original>
<translation></translation>
</phrase>

<phrase>
<original>Modify selection</original>
<translation></translation>
Expand All @@ -3047,7 +3057,7 @@ When finished, click the Submit New Issue button. Thank you!</original>
<translation>инструкциите за пријавување на бубачки</translation>
</phrase>

<!-- Processor.bas contains 128 phrases. 68 were duplicates of existing phrases, so only 60 new phrases were written to file. -->
<!-- Processor.bas contains 132 phrases. 70 were duplicates of existing phrases, so only 62 new phrases were written to file. -->

<phrase>
<original>automatic</original>
Expand Down Expand Up @@ -12691,7 +12701,7 @@ Would сакате да ги зачувате вашата листа сериј
<translation></translation>
</phrase>

<!-- Toolpanel_Typography.frm contains 60 phrases. 35 were duplicates of existing phrases, so only 25 new phrases were written to file. -->
<!-- Toolpanel_Typography.frm contains 64 phrases. 39 were duplicates of existing phrases, so only 25 new phrases were written to file. -->

<phrase>
<original>click here for detailed instructions (in English)</original>
Expand Down Expand Up @@ -13943,10 +13953,10 @@ If сеуште изберете да го исклучите ажурирања

<!-- Automatic text generation complete. -->

<phrasecount>2640</phrasecount>
<phrasecount>2642</phrasecount>

<!-- As of this build, PhotoDemon contains 5515 phrases. -->
<!-- 2875 are duplicates, so only 2640 unique phrases have been written to file. -->
<!-- These 2640 phrases contain approximately 11421 total words. -->
<!-- As of this build, PhotoDemon contains 5523 phrases. -->
<!-- 2881 are duplicates, so only 2642 unique phrases have been written to file. -->
<!-- These 2642 phrases contain approximately 11427 total words. -->

</pdData>
24 changes: 17 additions & 7 deletions App/PhotoDemon/Languages/Master/MASTER.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<langid>en-US</langid>
<langname>English (US) - MASTER COPY</langname>
<langversion>8.9.1705</langversion>
<langversion>9.0.15</langversion>
<langstatus>Automatically generated from PhotoDemon's source code</langstatus>

<author>Tanner Helland</author>
Expand Down Expand Up @@ -2992,6 +2992,16 @@ Description: %2
<translation></translation>
</phrase>

<phrase>
<original>last line justify</original>
<translation></translation>
</phrase>

<phrase>
<original>outline on top</original>
<translation></translation>
</phrase>

<phrase>
<original>Modify selection</original>
<translation></translation>
Expand All @@ -3014,7 +3024,7 @@ When finished, click the Submit New Issue button. Thank you!</original>
<translation></translation>
</phrase>

<!-- Processor.bas contains 128 phrases. 68 were duplicates of existing phrases, so only 60 new phrases were written to file. -->
<!-- Processor.bas contains 132 phrases. 70 were duplicates of existing phrases, so only 62 new phrases were written to file. -->

<phrase>
<original>automatic</original>
Expand Down Expand Up @@ -12642,7 +12652,7 @@ Would you like to save your batch list before exiting?</original>
<translation></translation>
</phrase>

<!-- Toolpanel_Typography.frm contains 60 phrases. 35 were duplicates of existing phrases, so only 25 new phrases were written to file. -->
<!-- Toolpanel_Typography.frm contains 64 phrases. 39 were duplicates of existing phrases, so only 25 new phrases were written to file. -->

<phrase>
<original>click here for detailed instructions (in English)</original>
Expand Down Expand Up @@ -13888,10 +13898,10 @@ If you still choose to disable updates, don't forget to visit photodemon.org fro

<!-- Automatic text generation complete. -->

<phrasecount>2640</phrasecount>
<phrasecount>2642</phrasecount>

<!-- As of this build, PhotoDemon contains 5515 phrases. -->
<!-- 2875 are duplicates, so only 2640 unique phrases have been written to file. -->
<!-- These 2640 phrases contain approximately 11421 total words. -->
<!-- As of this build, PhotoDemon contains 5523 phrases. -->
<!-- 2881 are duplicates, so only 2642 unique phrases have been written to file. -->
<!-- These 2642 phrases contain approximately 11427 total words. -->

</pdData>
Binary file modified App/PhotoDemon/Languages/Master/Phrases.db
Binary file not shown.
Loading

0 comments on commit 90eb363

Please sign in to comment.