Opened 16 years ago

Closed 15 years ago

#2715 closed enhancement (fixed)

terminal width char patch

Reported by: h.z Owned by: jackburton
Priority: normal Milestone: R1
Component: Applications/Terminal Version: R1/pre-alpha1
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

Enable support for B_GBK_CONVERSION and B_BIG5_CONVERSION, enable all font family not only just fixed, add "width" to "BasicTerminalBuffer::InsertChar" (CodeConv::UTF8GetFontWidth just not works), just like old MuTerm. In TermView::Draw, add IS_WIDTH attribute, or fonts drawing will be the one on the right from snapshot view, only paint left half.

Attachments (2)

terminal-width-char.jpg (279.6 KB ) - added by h.z 16 years ago.
left one is patched terminal, right one is not
terminal-width-char.patch (5.7 KB ) - added by h.z 16 years ago.
fix fixed font checking

Download all attachments as: .zip

Change History (10)

by h.z, 16 years ago

Attachment: terminal-width-char.jpg added

left one is patched terminal, right one is not

by h.z, 16 years ago

Attachment: terminal-width-char.patch added

fix fixed font checking

comment:1 by jackburton, 16 years ago

Status: newassigned

Hi, first of all thanks for your work. There are some issues with this patch, though: I don't like much how the fonts are filtered. We should, instead, implement BFont::IsFullAndHalfFixed() so that we can use it also in other places. I can try to do that using your code. There are some minor style issue (width_ok instead of widthOk, for example), but I can take care of this, I think.

in reply to:  1 comment:2 by h.z, 16 years ago

I think that filter is a dirty hack, just taken from font width calc. Implement of BFont::IsFullAndHalfFixed() will be great. I will notice the style issue next time, thanks.

comment:3 by korli, 16 years ago

I'm wondering what width exactly is : is it the display width ? Isn't there another way to know this width based on a character ?

in reply to:  3 comment:4 by jackburton, 16 years ago

Replying to korli:

I'm wondering what width exactly is : is it the display width ? Isn't there another way to know this width based on a character ?

See the comments in bug #947, please.

in reply to:  3 comment:5 by h.z, 16 years ago

Replying to korli:

I'm wondering what width exactly is : is it the display width ? Isn't there another way to know this width based on a character ?

I think,

  1. is the font width, no matter is half or full width, must be fixed width, or "TermView" will be massed up.
  2. is the char width, during the "TermParse", the char width will be calculated and "TermView::Draw" use width attribute, or only paint the left half.

comment:6 by bonefish, 16 years ago

Some quick observations:

  • There are several places in BasicTerminalBuffer (and maybe other classes) that lack special handling for full width chars. Some are even marked with a TODO.
  • If CodeConv::UTF8GetFontWidth() is not needed, it should be removed.

comment:7 by jackburton, 16 years ago

I applied the patch (with a few changes from myself) in hrev29129. I tested with Konatu Tohaba font and it seems to work correctly. Let me know if I can close this. Thanks for your work!

comment:8 by jackburton, 15 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.