Skip to content

Fontchooser improvements #77

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

Open
wants to merge 28 commits into
base: master
Choose a base branch
from

Conversation

rdbende
Copy link
Member

@rdbende rdbende commented Mar 22, 2021

I've made a few little improvements for ttkwidgets.font:

  • Default font family and size option for both FontChooser and FontSelectFrame, and all subwidgets
  • AutocompleteEntryListbox for FontChooser instead of a label and a listbox
  • 3 lang translation for both FontChooser and FontSelectFrame (DE, HU, FR(just for consistency with other dialogs, I had to use DeepL for it))
  • GUI redesign for FontChooser: LabelFrames, preview frame redesign, dialog buttons were moved
  • FontChooser Toplevel improvements: master, .transient(), .wait_visibility(), .lift(), .grab_set() (just like in ColorPicker)

image

@RedFantom RedFantom self-requested a review March 23, 2021 23:50
@RedFantom RedFantom self-assigned this Mar 23, 2021
@@ -49,7 +54,7 @@ def selection(self):
:return: None if no font is selected and font family name if one is selected.
:rtype: None or str
"""
if self._font.get() is "" or self._font.get() not in self._fonts:
if self._font.get() == "" or self._font.get() not in self._font_families:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first part of this condition is useless. An empty string won't be in the font family list anyways.

# --- Translation
EN = {"Font properties:": "Font properties:"}

FR = {"Font properties:": "Propriétés"}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Propriétés works, but if we were to be specific, it would be Propriétés de police d'écriture or just Propriétés de police.

It depends on the context (source : am french)

Comment on lines +13 to +20
# --- Translation
EN = {"Font properties:": "Font properties:"}

FR = {"Font properties:": "Propriétés"}

DE = {"Font properties:": "Eigenschaften"}

HU = {"Font properties:": "Betűstílus"}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good imo to create a utility class to provide translations and internationalization, so that it can be used across the entire lib, as well as be editable by the programmer.

I'll make a separate PR about this to add such a functionnality.

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.

3 participants