classification
Title: IDLE Prefernces/Fonts: use multiple alphabets in examples
Type: enhancement Stage: needs patch
Components: IDLE Versions: Python 3.7, Python 3.6
process
Status: open Resolution:
Dependencies: 24776 Superseder:
Assigned To: terry.reedy Nosy List: Todd.Rovito, francismb, louielu, roger.serwy, serhiy.storchaka, terry.reedy
Priority: normal Keywords: patch

Created on 2012-01-16 23:22 by terry.reedy, last changed 2017-07-21 02:36 by terry.reedy.

Files
File name Uploaded Description Edit
issue13802.patch francismb, 2013-03-23 19:49 Some more example chars review
Pull Requests
URL Status Linked Edit
PR 2616 open louielu, 2017-07-07 07:37
Messages (10)
msg151415 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2012-01-16 23:22
In the Fonts/Tabs tab of the IDLE Preference dialog, the large box for examples of the font selected shows a small square of ascii chars. I think the box should also show 1 char for each of several alphabets so the consequence of choosing various fonts will be more evident. I am thinking of adding several line with the format
Alphabet \uXXXX <char>
msg185080 - (view) Author: Francis MB (francismb) * Date: 2013-03-23 19:49
Hi Terry,
just take/put away some ... (they're not in a special order nor preference, just some that could 'see' in the browser).
msg297868 - (view) Author: Louie Lu (louielu) * Date: 2017-07-07 08:12
Add the string with pangram and chinese, now sample text shows:

AaBbCcDdEe
FfGgHhIiJjK
1234567890
#:+=(){}[]

The quick brown fox jumps over the lazy dog. [1]

南去經三國,東來過五湖 [2]

----------------------


[1]: https://en.wikipedia.org/wiki/The_quick_brown_fox_jumps_over_the_lazy_dog

[2]: http://blog.justfont.com/2014/12/jfbook-example/
msg297869 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-07-07 08:20
There are many different alphabets in the world. Why Chines but not Cyrillic or Devanagari? An example that includes all scripts would be too large (and likely most characters would not be rendered correctly with an arbitrary font).

I suggest just make the box for examples editable and save entered examples in the configuration files.
msg297870 - (view) Author: Louie Lu (louielu) * Date: 2017-07-07 08:32
Serhiy: Or would it be to detect the user language environment, and come up with user language example sentence? What I remember that Windows font preview will change the sentence in the different language.
msg297878 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-07-07 10:17
I don't think that it is worth to include in Python distribution examples for a hundred of languages. If there are some system-wide collections of examples we can use them, but this should be platform specific and not always available.
msg297883 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-07-07 13:45
On other hand, we can use the standard font chooser dialog. But it doesn't allow to configure the sample text at all (at least on X Window).

Terry, try please the following commands on Windows:

import tkinter
root = tkinter.Tk()
root.tk.call('tk', 'fontchooser', 'show')

How it looks?
msg298408 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-07-15 23:14
I made this issue a dependency of #24776, which is about redoing the whole font page.

The fontchooser has good, inappropriate for IDLE, and bad points.  I consider it an alternate mockup proposal for the font page.  For this issue: displaying each font name in the font is cute, but I am not sure I want to imitate.  I address the sample selection below. 

This issue  is about making it evident that IDLE is a BMP unicode editor, not just an ASCII editor; and about showing the consequence of font choices on a particular OS and machine.  Expanding the static sample with example of the top N scripts, with N about 10, will do this.

When I looked at Francis's patch, I thought it deficient in that people would not know what chars were being replaced by boxes.  Then I tried the patch and none of them were.  At least not on Windows.  Since I opened this, we added back the Help button.  Added help text for this tab can list the scripts represented in the sample.  If nothing else, I will use this patch, as it improves of the status quo.  I should have done this years ago.  An immediate improvement would be all chars from a script on one line and some (more?) hanji/kanji CJK chars.

#24776 suggests putting the sample beside the font selection box.  The font box only needs 75% of the width it has.  With the frame around the sample label removed, there may be more width available.  There will certainly be more lines.

Louie, I understand your PR to be a suggestion about pangrams, expressed in code, to be 'pulled' into my mind, and possibly into my clone, and not a request to merge as is with only Chinese.  Others have noted that submitting work-in-progess patches as PRs, rather than as diffs to the tracker, can be confusing.  Yet it makes review easy.

In considering the idea, I looked at https://en.wikipedia.org/wiki/Pangram and also found http://clagnut.com/blog/2380/, which lists pangrams in multiple languages that were once on wiki/List_of_Pangrams.

I am rejecting the idea as is for multiple related reasons.  The sample is about scripts, not languages.  Long phrases mean fewer scripts.  Many scripts are used for multiple dialects or even languages.  Which one to choose?  An innocent or poetic phrase in one language may be less innocent in another dialect/language, or if interpreted metaphorically, or one consider possible alternate meanings of words.

One thing I would consider is script names written in the script.  This would replace an arbitrary sample from the same script and could be done on a script-by-script basis.  I believe 'devanagari' in Devanagari should be intelligible in all or most north Indian languages that use Devanagari or derivatives thereof, and offensive in none.  But I would enquire.

What do others think of this?

Louie, I presume 'hanji' is a single char.  How about using the stroke pangram 永 (all basic strokes) in a phrase such as 'hanji character 永'?  (I like the look of the char as well).

Serhiy, is there one non-controversial pan-slavic way to write 'Cyrillic' in Cyrillic?  Or controversy-engendering national variations?

A separate issue could add a button and dropdown multiple selection list to print to an output window all or a selection of the 256 blocks of 256 codepoints in the BMP. This should eliminate any need for a configuration option.

> likely most characters would not be rendered correctly with an arbitrary font

A goal of this issue is to let people see such problems where they exist.

The fontchooser sample awful.  Only couple of ascii and script chars and a small sample of script that changes with each script.  It has no knowledge of default characters.
msg298413 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-07-16 04:27
> Serhiy, is there one non-controversial pan-slavic way to write 'Cyrillic' in Cyrillic?

No. Even in very close east-slavic languages it is written differently: Ukrainian "Кирилиця", Russian "Кириллица", Belarusian "Кірыліца".
msg298762 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-07-21 02:36
I decided to rearrange page #24776 before changing sample #13802.
History
Date User Action Args
2017-07-21 02:37:00terry.reedyunlinkissue24776 dependencies
2017-07-21 02:36:45terry.reedysetdependencies: + IDLE: Improve config dialog font change user interface
messages: + msg298762
2017-07-16 04:27:47serhiy.storchakasetmessages: + msg298413
2017-07-15 23:14:55terry.reedysetmessages: + msg298408
stage: patch review -> needs patch
2017-07-10 22:05:15terry.reedylinkissue24776 dependencies
2017-07-07 13:45:16serhiy.storchakasetmessages: + msg297883
2017-07-07 10:17:42serhiy.storchakasetmessages: + msg297878
2017-07-07 08:32:09louielusetmessages: + msg297870
2017-07-07 08:20:28serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg297869
2017-07-07 08:12:17louielusetnosy: + louielu
messages: + msg297868
2017-07-07 07:37:15louielusetpull_requests: + pull_request2682
2017-06-30 01:30:39terry.reedysetassignee: terry.reedy
stage: needs patch -> patch review
versions: + Python 3.6, Python 3.7, - Python 2.7, Python 3.3, Python 3.4
2013-06-15 18:50:45terry.reedysetversions: + Python 3.4, - Python 3.2
2013-03-25 15:56:40Todd.Rovitosetnosy: + roger.serwy
2013-03-24 05:26:26Todd.Rovitosetnosy: + Todd.Rovito
2013-03-23 19:49:32francismbsetfiles: + issue13802.patch

nosy: + francismb
messages: + msg185080

keywords: + patch
2012-01-16 23:22:19terry.reedycreate