twig / dcxdll

Dialog Control eXtensions for mIRC
BSD 3-Clause "New" or "Revised" License
23 stars 2 forks source link

RichEdit - incorrect display of the font in UTF-8 encoding #35

Open EpicNet opened 3 years ago

EpicNet commented 3 years ago

I am using "mIRC v7.66" + "DCX dll v3.1-git394" in system "Windows 8.1 x64".

I tried using this control following the reference documentation, but it doesn't seem to work correctly. For the demonstration, I first wrote the text in Russian, then I used various emoji symbols, and then I wrote the text in English. But it turns out that changing the language affects the font, its boldness and its size, despite what was originally set for this control. And special characters are displayed as unknown characters as squares, which I don't like at all.

It seems that the "UTF-8" encoding is not fully supported, or it is completely absent and it looks like the command "/xdid -f" to install the font does nothing, no matter how I try to change to new parameters. This is a rather strange behavior for the control. It would be nice if this was all fixed and becomes manageable.

You will also probably need to add a new parameter for the universal encoding: "/xdid -f $dname 1 +a utf-8 10 Comic Sans MS"

For verification, I used the following symbols: Всем привет ⚠ 🚩 ★ 📜 ♟ ♞ ♝ ♜ ♛ ♚ Hello everyone You can check this with any other national symbols, the result will be the same.


image

Here is a test piece of script to reproduce this the problem. To run the script click on "F5" or enter the command "/richedit_test":

alias F5 { richedit_test }
alias richedit_test {
  if ($dialog(richedit_test)) .dialog -x richedit_test
  else { .dialog -m richedit_test richedit_test }
}
dialog richedit_test {
  title "RichEdit test"
  icon $mircexe,0
  option pixels
  size -1 -1 400 43
}
on *:DIALOG:richedit_test:init:*:{
  .dcx Mark $dname richedit_test_work
  .xdialog -b $dname +ty
  .xdialog -g $dname +b $rgb(20,20,27)
  .xdialog -c $dname 1 richedit 10 10 380 23
  .xdid -f $dname 1 +a ansi 10 Comic Sans MS
}
alias richedit_test_work {}