Skip to content

Big5 support#1808

Merged
vadi2 merged 6 commits intoMudlet:developmentfrom
pkerichang:big5-support
Jul 15, 2018
Merged

Big5 support#1808
vadi2 merged 6 commits intoMudlet:developmentfrom
pkerichang:big5-support

Conversation

@pkerichang
Copy link
Copy Markdown
Contributor

Brief overview of PR changes/additions

This is a re-submit of the big5 encoding support pull request, with a more descriptive branch name.

@pkerichang pkerichang requested a review from a team as a code owner July 12, 2018 21:28
@pkerichang pkerichang requested a review from a team July 12, 2018 21:28
SlySven
SlySven previously approved these changes Jul 13, 2018
Copy link
Copy Markdown
Member

@SlySven SlySven left a comment

Choose a reason for hiding this comment

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

This looks good to go. I trust that the whole thing is working now we reverted that other PR that broke things...

@SlySven SlySven dismissed their stale review July 14, 2018 01:11

Realised that a further change was neeed - will reappove when that is done or agreed to be unnecessary

@SlySven
Copy link
Copy Markdown
Member

SlySven commented Jul 14, 2018

I have managed to make a connection to that MUD that you used and it seems to work, but will leave squashing and merging to @vadi2 depending on whether he wants to drop it into the next release or hold it to the one afterwards:
screenshot_20180714_014202

Ah - there is one question that we need to address before merging and that is "what width setting should East Asian ambiguous width characters" be drawn with by default for this encoding - I would tend to think that it is likely to need to be "Wide" for this encoding but could you @pkerichang try setting the option to both the narrow (unchecked) and wide (checked) setting and tell us which the default (partially checked) setting should default to when "Big5" is selected?
screenshot_20180714_015155

I think such characters need to be drawn as wide as by default so this encoding (besides GBK and GB18030) should use the wide setting - to do this can you edit the above tool-tip which is set in the dlgProfilePreferences constructor:

    checkBox_useWideAmbiguousEastAsianGlyphs->setToolTip(QStringLiteral("<html><head/><body>%1</body></html>")
                                                         .arg("<p>Some East Asian MUDs may use glyphs (characters) that Unicode classifies as being "
                                                              "of <i>Ambigous</i> width when drawn in a font with a so-called <i>fixed</i> pitch; in "
                                                              "fact such text is <i>duo-spaced</i> when not using a proportional font. These symbols can be "
                                                              "drawn using either a half or the whole space of a full character. By default Mudlet tries to "
                                                              "chose the right width automatically but you can override the setting for each profile.</p>"
                                                              "<p>This control has three settings:"
                                                              "<ul><li><b>Unchecked</b> '<i>narrow</i>' = Draw ambiguous width characters in a single 'space'.</li>"
                                                              "<li><b>Checked</b> '<i>wide</i>' = Draw ambiguous width characters two 'spaces' wide.</li>"
                                                              "<li><b>Partly checked</b> <i>(Default) 'auto'</i> = Use 'wide' setting for MUD Server "
                                                              "encodings of <b>GBK</b> or <b>GBK18030</b> and 'narrow' for all others.</li></ul></p>"
                                                              "<p><i>This is a temporary arrangement and will likely to change when Mudlet gains "
                                                              "full support for languages other than English.</i></p>"));

by changing the line:

"encodings of <b>GBK</b> or <b>GBK18030</b> and 'narrow' for all others.</li></ul></p>"

to:

"encodings of <b>Big5</b>, <b>GBK</b> or <b>GBK18030</b> and 'narrow' for all others.</li></ul></p>"

If you can also change:

 "<p><i>This is a temporary arrangement and will likely to change when Mudlet gains "

to:

 "<p><i>This is a temporary arrangement and will be likely to change when Mudlet gains "

that will also fix a typo that I have just spotted! 😀

To actually make the effect take place in code, go to Host.cpp and change the following method at the indicated place:

 void Host::setWideAmbiguousEAsianGlyphs(const Qt::CheckState state)
 {
     bool localState = false;
     bool needToEmit = false;
     const QString encoding(mTelnet.getEncoding());

     QMutexLocker locker(& mLock);
     if (state == Qt::PartiallyChecked) {
         // Set things automatically
         mAutoAmbigousWidthGlyphsSetting = true;

-        if ( encoding == QLatin1String("GBK")
+        if ( encoding == QLatin1String("Big5")
+           || encoding == QLatin1String("GBK")
            || encoding == QLatin1String("GB18030")) {

             // Need to use wide width for ambiguous characters
             if (!mWideAmbigousWidthGlyphs) {
                 // But the last setting was narrow - so we need to change
                 mWideAmbigousWidthGlyphs = true;
                 localState = true;
                 needToEmit = true;
             }

         } else {
             // Need to use narrow width for ambiguous characters
             if (mWideAmbigousWidthGlyphs) {
                 // But the last setting was wide - so we need to change
                 mWideAmbigousWidthGlyphs = false;
                 localState = false;
                 needToEmit = true;
             }

         }

     } else {
         // Set things manually:
         mAutoAmbigousWidthGlyphsSetting = false;
         if (mWideAmbigousWidthGlyphs != (state == Qt::Checked)) {
             // The last setting is the opposite to what we want:

             mWideAmbigousWidthGlyphs = (state == Qt::Checked);
             localState = (state == Qt::Checked);
             needToEmit = true;
         };

     }

     locker.unlock();
     // We do not need to keep the mutex any longer as we have a local copy to
     // work with whilst the connected methods react to the signal:
     if (needToEmit) {
         emit signal_changeIsAmbigousWidthGlyphsToBeWide(localState);
     }
 }

OTOH If you do not think that this change is needed can you confirm this - then these changes will not be needed. In case you do not understand it I will point you to https://www.unicode.org/reports/tr11/tr11-35.html .

@pkerichang
Copy link
Copy Markdown
Contributor Author

Hello,

I do think it is a good idea to change default width of ambiguous characters. I've committed the changes.

@vadi2
Copy link
Copy Markdown
Member

vadi2 commented Jul 14, 2018

@pkerichang would it be OK for this to wait for the next release (in a month or sooner)? We're releasing tomorrow and are in the new features freeze now.

@pkerichang
Copy link
Copy Markdown
Contributor Author

I'm fine with that. Thanks for letting me know.

Copy link
Copy Markdown
Member

@SlySven SlySven left a comment

Choose a reason for hiding this comment

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

👍 Okay

@SlySven SlySven added this to the 3.12 milestone Jul 14, 2018
@vadi2 vadi2 merged commit 8161ea8 into Mudlet:development Jul 15, 2018
@vadi2
Copy link
Copy Markdown
Member

vadi2 commented Jul 16, 2018

@pkerichang it actually made it into 3.11.1, fyi

SlySven added a commit to SlySven/Mudlet that referenced this pull request Aug 2, 2018
# By Vadim Peretokin (81) and others
* development: (162 commits)
  BugFix: set Server Encoding correctly on auto-loading profiles
  Install xz-utils to guarantee xz is available
  Create and upload source tarballs on release
  BugFix: use Alternative OpenSSLBinary for Windows (Mudlet#1850)
  Fix auto-save kicking in and blocking save profile as
  Upgrade a few classes to newer Qt connect style (Mudlet#1846)
  Fix package exporter to work with async save (Mudlet#1832)
  Pulled out actions into a mudlet member class variables (Mudlet#1839)
  Create module zip if it's not already created when syncing (Mudlet#1842)
  i18n-ise GUI label creation (Mudlet#1838)
  Align "no map"message in centre propely (Mudlet#1837)
  New Crowdin translations (Mudlet#1756)
  Delete old version checks (Mudlet#1833)
  Re-set dev.
  3.11.1 bugfix release.
  Fix iterator to actually iterate
  BugFix: fix faulty log options for new profiles or old profile save files
  Big5 support (Mudlet#1808)
  BugFix: include a fail-back icon for the auto-saved profile in Con. Dialog
  Back to development we go!
  ...

Conflicts resolved in:
* src/TTextEdit.cpp
* src/TTextEdit.h

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
SlySven added a commit to SlySven/Mudlet that referenced this pull request Jun 22, 2020
# By Vadim Peretokin (24) and others
# Via keneanung
* development: (52 commits)
  Install xz-utils to guarantee xz is available
  Create and upload source tarballs on release
  BugFix: use Alternative OpenSSLBinary for Windows (Mudlet#1850)
  Fix auto-save kicking in and blocking save profile as
  Upgrade a few classes to newer Qt connect style (Mudlet#1846)
  Fix package exporter to work with async save (Mudlet#1832)
  Pulled out actions into a mudlet member class variables (Mudlet#1839)
  Create module zip if it's not already created when syncing (Mudlet#1842)
  i18n-ise GUI label creation (Mudlet#1838)
  Align "no map"message in centre propely (Mudlet#1837)
  New Crowdin translations (Mudlet#1756)
  Delete old version checks (Mudlet#1833)
  Re-set dev.
  3.11.1 bugfix release.
  Fix iterator to actually iterate
  BugFix: fix faulty log options for new profiles or old profile save files
  Big5 support (Mudlet#1808)
  BugFix: include a fail-back icon for the auto-saved profile in Con. Dialog
  Back to development we go!
  3.11.0 release
  ...

Conflicts resolved in:
* src/dlgProfilePreferences.cpp
* src/mudlet.qrc

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants