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)
Change History (10)
by , 16 years ago
Attachment: | terminal-width-char.jpg added |
---|
follow-up: 2 comment:1 by , 16 years ago
Status: | new → assigned |
---|
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.
comment:2 by , 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.
follow-ups: 4 5 comment:3 by , 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 ?
comment:4 by , 16 years ago
comment:5 by , 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,
- is the font width, no matter is half or full width, must be fixed width, or "TermView" will be massed up.
- 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 , 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 , 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 , 15 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
left one is patched terminal, right one is not