Date: Sat, 18 Mar 2017 20:35:05 +0000 From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 205707] Improve parsing of BDFs by vtfontcvt Message-ID: <bug-205707-8-OGSXV6AnUa@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-205707-8@https.bugs.freebsd.org/bugzilla/> References: <bug-205707-8@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D205707 Henry Hu <henry.hu.sh@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |henry.hu.sh@gmail.com --- Comment #6 from Henry Hu <henry.hu.sh@gmail.com> --- Created attachment 180939 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D180939&action= =3Dedit read FONTBOUNDINGBOX and BBX, handle other DWIDTH I tried to convert fonts in x11-fonts/wqy (an open source Chinese bitmap fo= nt) for use with vt. The original fonts are in pcf, I used https://github.com/ganaware/pcf2bdf to convert them to bdf. I found that the original assumptions in the code have several problems: * Assuming DWIDTH =3D width or width * 2 Actually there can be varying widths. For wqy, there are DWIDTH between 2-13 for the 10pt font, and 2-12 for the 9pt font. * Assuming number of lines in the bitmap =3D=3D height Actually it usually equals to the height in the BBX line. This patch fixes the problems by: * Read the FONTBOUNDINGBOX line. This gives us the baseline position. If offset_y in this line is -3, we nee= d to reserve 3 lines at the bottom. * Read the BBX line. The offset_x and offset_y information in this line tells us where to positi= on the glyph. For example, if offset_y =3D=3D -2, the font should be positione= d 2 lines below the baseline. * Position the glyph at the correct place. The starting line is calculated by: line_y =3D height + font_y - bb_h - bb_y + i; The font's baseline (bottom) is height + font_y, the glyph's baseline is he= ight + font_y - bb_y. The font generated by this patch is used successfully with the wqy font on = the vt terminal to display chinese characters. There seems to be problems for alphabet characters which are double-width (the 'W' in wqy font), so the working configuration requires a width of at least 10 pixels. --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-205707-8-OGSXV6AnUa>