1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-03 06:04:53 +00:00

Add big5width 1.0: Unicode width dirty fix for Big5 font (zh_TW.UTF-8 locale).

Obtained from:	Kuang-che Wu (kcwu at csie.org)
This commit is contained in:
Rong-En Fan 2006-11-10 20:13:09 +00:00
parent c9971cf360
commit 5521351915
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=177017
6 changed files with 250 additions and 0 deletions

View File

@ -19,6 +19,7 @@
SUBDIR += bg5ps
SUBDIR += big5con
SUBDIR += big5fs
SUBDIR += big5width
SUBDIR += bind8
SUBDIR += bitchx
SUBDIR += c2t

View File

@ -0,0 +1,57 @@
# New ports collection makefile for: big5width
# Date created: Sep 20 2006
# Whom: Rong-En Fan <rafan@FreeBSD.org>
#
# $FreeBSD$
#
PORTNAME= big5width
PORTVERSION= 1.0
CATEGORIES= chinese
MASTER_SITES= # none
DISTFILES= # none
MAINTAINER= rafan@FreeBSD.org
COMMENT= Unicode width dirty fix for Big5 font (${LANG} locale)
BASELOCALEDIR= ${DESTDIR}/usr/share/locale
LOCALEDIR= ${PREFIX}/share/locale
LANG= zh_TW.UTF-8
PLIST_SUB= BASELOCALEDIR=${BASELOCALEDIR} \
LOCALEDIR=${LOCALEDIR} \
LANG=${LANG}
.include <bsd.port.pre.mk>
.if ${OSVERSION} < 502110
IGNORE= requires UTF-8 locales in base system
.endif
SRCBASE?= ${PORTSDIR}/../src
SRCDIR= ${SRCBASE}/share/mklocale
.if !exists(${SRCDIR})
IGNORE= need to build this port with the locale source
.endif
do-extract:
@${MKDIR} ${WRKDIR}
@${CP} -R ${SRCDIR} ${WRKSRC}
@${CP} ${WRKSRC}/UTF-8.src ${WRKSRC}/${LANG}.src
do-build:
/usr/bin/mklocale -o ${WRKSRC}/LC_CTYPE ${WRKSRC}/${LANG}.src
do-install:
${MKDIR} ${LOCALEDIR}/${LANG}
${INSTALL_DATA} ${WRKSRC}/LC_CTYPE ${LOCALEDIR}/${LANG}
${CP} -p ${BASELOCALEDIR}/${LANG}/LC_CTYPE \
${LOCALEDIR}/${LANG}/LC_CTYPE.old
${LN} -sf ${LOCALEDIR}/${LANG}/LC_CTYPE \
${BASELOCALEDIR}/${LANG}/LC_CTYPE
post-install:
@${CAT} ${PKGMESSAGE}
.include <bsd.port.post.mk>

View File

@ -0,0 +1,172 @@
--- zh_TW.UTF-8.src Sat Mar 27 16:14:14 2004
+++ zh_TW.UTF-8.src Wed Sep 1 20:19:44 2004
@@ -77,7 +75,8 @@
BLANK 0x00a0
PRINT 0x00a0 - 0x00ff
SPECIAL 0x00b2 0x00b3 0x00b9 0x00bc - 0x00be
-SWIDTH1 0x00a0 - 0x00ff
+SWIDTH1 0x00a0 - 0x00a6 0x00a9 - 0x00af 0x00b2 - 0x00b6 0x00b8 - 0x00d6 0x00d8 - 0x00f6 0x00f8 - 0x00ff
+SWIDTH2 0x00a7 0x00a8 0x00b0 0x00b1 0x00b7 0x00d7 0x00f7
MAPUPPER < 0x00b5 0x039c >
MAPUPPER < 0x00e0 - 0x00f6 : 0x00c0 >
@@ -480,7 +479,8 @@
GRAPH 0x02b0 - 0x02ee
PUNCT 0x02b9 0x02ba 0x02c2 - 0x02cf 0x02d2 - 0x02df 0x02e5 - 0x02ed
PRINT 0x02b0 - 0x02ee
-SWIDTH1 0x02b0 - 0x02ee
+SWIDTH1 0x02b0 - 0x02c6 0x02c8 0x02cc 0x02ce - 0x02d8 0x02da - 0x02ee
+SWIDTH2 0x02c7 0x02c9 - 0x02cb 0x02cd 0x02d9
/*
@@ -513,7 +513,8 @@
PRINT 0x0374 0x0375 0x037a 0x037e 0x0384 - 0x038a 0x038c
PRINT 0x038e - 0x03a1 0x03a3 - 0x03ce 0x03d0 - 0x03f6
SWIDTH1 0x0374 0x0375 0x037a 0x037e 0x0384 - 0x038a 0x038c
-SWIDTH1 0x038e - 0x03a1 0x03a3 - 0x03ce 0x03d0 - 0x03f6
+SWIDTH1 0x038e - 0x0390 0x03aa - 0x03b0 0x03c2 0x03ca - 0x03ce 0x03d0 - 0x03f6
+SWIDTH2 0x0391 - 0x03a1 0x03a3 - 0x03a9 0x03b1 - 0x03c1 0x03c3 - 0x03c9
MAPUPPER < 0x03ac 0x0386 >
MAPUPPER < 0x03ad - 0x03af : 0x0388 >
@@ -1616,7 +1617,8 @@
BLANK 0x2000 - 0x200b 0x202f 0x205f
PRINT 0x2000 - 0x200b 0x2010 - 0x2029 0x202f - 0x2052 0x2057
PRINT 0x205f
-SWIDTH1 0x2000 - 0x200b 0x2010 - 0x2029 0x202f - 0x2052 0x2057
+SWIDTH1 0x2000 - 0x200b 0x2010 - 0x2013 0x2016 0x2017 0x201a 0x201b 0x201e - 0x2024 0x2028 0x2029 0x202f - 0x2031 0x2033 0x2034 0x2036 - 0x203a 0x203c 0x203d 0x203f - 0x2052 0x2057
+SWIDTH2 0x2014 0x2015 0x2018 0x2019 0x201c 0x201d 0x2025 - 0x2027 0x2032 0x2035 0x203b 0x203e
SWIDTH1 0x205f
@@ -1640,7 +1642,8 @@
GRAPH 0x20a0 - 0x20b1
PUNCT 0x20a0 - 0x20b1
PRINT 0x20a0 - 0x20b1
-SWIDTH1 0x20a0 - 0x20b1
+SWIDTH1 0x20a0 - 0x20ab 0x20ad - 0x20b1
+SWIDTH2 0x20ac
/*
@@ -1669,7 +1672,8 @@
UPPER 0x2119 - 0x211d 0x2124 0x2126 0x2128 0x212a - 0x212d
UPPER 0x2130 0x2131 0x2133 0x213e 0x213f 0x2145
PRINT 0x2100 - 0x213a 0x213d - 0x214b
-SWIDTH1 0x2100 - 0x213a 0x213d - 0x214b
+SWIDTH1 0x2100 - 0x2102 0x2104 0x2106 - 0x2108 0x210a - 0x213a 0x213d - 0x214b
+SWIDTH2 0x2103 0x2105 0x2109
MAPLOWER < 0x2126 0x03c9 >
MAPLOWER < 0x212a 'k' >
@@ -1683,7 +1687,8 @@
GRAPH 0x2153 - 0x2183
PRINT 0x2153 - 0x2183
SPECIAL 0x2153 - 0x2183
-SWIDTH1 0x2153 - 0x2183
+SWIDTH1 0x2153 - 0x215f 0x216a - 0x216f 0x217a - 0x2183
+SWIDTH2 0x2160 - 0x2169 0x2170 - 0x2179
MAPUPPER < 0x2170 - 0x217f : 0x2160 >
MAPLOWER < 0x2160 - 0x216f : 0x2170 >
@@ -1696,7 +1701,8 @@
GRAPH 0x2190 - 0x21ff
PUNCT 0x2190 - 0x21ff
PRINT 0x2190 - 0x21ff
-SWIDTH1 0x2190 - 0x21ff
+SWIDTH1 0x2194 0x2195 0x219a - 0x21ff
+SWIDTH2 0x2190 - 0x2193 0x2196 - 0x2199
/*
@@ -1706,7 +1712,8 @@
GRAPH 0x2200 - 0x22ff
PUNCT 0x2200 - 0x22ff
PRINT 0x2200 - 0x22ff
-SWIDTH1 0x2200 - 0x22ff
+SWIDTH1 0x2200 - 0x2214 0x2216 - 0x2219 0x221b - 0x221d 0x2221 0x2222 0x2224 0x2226 - 0x2228 0x222c 0x222d 0x222f - 0x2233 0x2236 - 0x2251 0x2253 - 0x225f 0x2262 - 0x2265 0x2268 - 0x2294 0x2296 - 0x2298 0x229a - 0x22a4 0x22a6 - 0x22be 0x22c0 - 0x22ff
+SWIDTH2 0x2215 0x221a 0x221e - 0x2220 0x2223 0x2225 0x2229 - 0x222b 0x222e 0x2234 0x2235 0x2252 0x2260 0x2261 0x2266 0x2267 0x2295 0x2299 0x22a5 0x22bf
/*
@@ -1727,7 +1734,8 @@
GRAPH 0x2400 - 0x2426
PUNCT 0x2400 - 0x2426
PRINT 0x2400 - 0x2426
-SWIDTH1 0x2400 - 0x2426
+SWIDTH1 0x2420 0x2422 - 0x2426
+SWIDTH2 0x2400 - 0x241f 0x2421
/*
@@ -1748,7 +1756,8 @@
PUNCT 0x249c - 0x24e9
PRINT 0x2460 - 0x24fe
SPECIAL 0x2460 - 0x249b 0x24ea - 0x24fe
-SWIDTH1 0x2460 - 0x24fe
+SWIDTH1 0x246a - 0x2473 0x247e - 0x24fe
+SWIDTH2 0x2460 - 0x2469 0x2474 - 0x247d
MAPUPPER < 0x24d0 - 0x24e9 : 0x24b6 >
MAPLOWER < 0x24b6 - 0x24cf : 0x24d0 >
@@ -1761,7 +1770,8 @@
GRAPH 0x2500 - 0x257f
PUNCT 0x2500 - 0x257f
PRINT 0x2500 - 0x257f
-SWIDTH1 0x2500 - 0x257f
+SWIDTH1 0x2503 - 0x250b 0x250d - 0x250f 0x2511 - 0x2513 0x2515 - 0x2517 0x2519 - 0x251b 0x251e - 0x2523 0x2526 - 0x252b 0x252d - 0x2533 0x2535 - 0x253b 0x253d 0x253e 0x2540 - 0x254f 0x2575 - 0x257f
+SWIDTH2 0x2500 - 0x2502 0x250c 0x2510 0x2514 0x2518 0x251c 0x251d 0x2524 0x2525 0x252c 0x2534 0x253c 0x253f 0x2550 - 0x2574
/*
@@ -1771,7 +1781,8 @@
GRAPH 0x2580 - 0x259f
PUNCT 0x2580 - 0x259f
PRINT 0x2580 - 0x259f
-SWIDTH1 0x2580 - 0x259f
+SWIDTH1 0x2580 0x2590 - 0x2592 0x2596 - 0x259f
+SWIDTH2 0x2581 - 0x258f 0x2593 - 0x2595
/*
@@ -1781,7 +1792,8 @@
GRAPH 0x25a0 - 0x25ff
PUNCT 0x25a0 - 0x25ff
PRINT 0x25a0 - 0x25ff
-SWIDTH1 0x25a0 - 0x25ff
+SWIDTH1 0x25a2 - 0x25b1 0x25b4 - 0x25bb 0x25be - 0x25c5 0x25c8 - 0x25ca 0x25cc 0x25cd 0x25d0 - 0x25e1 0x25e6 - 0x25ff
+SWIDTH2 0x25a0 0x25a1 0x25b2 0x25b3 0x25bc 0x25bd 0x25c6 0x25c7 0x25cb 0x25ce 0x25cf 0x25e2 - 0x25e5
/*
@@ -1791,7 +1803,8 @@
GRAPH 0x2600 - 0x2613 0x2616 0x2617 0x2619 - 0x267d 0x2680 - 0x2689
PUNCT 0x2600 - 0x2613 0x2616 0x2617 0x2619 - 0x267d 0x2680 - 0x2689
PRINT 0x2600 - 0x2613 0x2616 0x2617 0x2619 - 0x267d 0x2680 - 0x2689
-SWIDTH1 0x2600 - 0x2613 0x2616 0x2617 0x2619 - 0x267d 0x2680 - 0x2689
+SWIDTH1 0x2600 - 0x2604 0x2607 - 0x2613 0x2616 0x2617 0x2619 - 0x263f 0x2641 0x2643 - 0x267d 0x2680 - 0x2689
+SWIDTH2 0x2605 0x2606 0x2640 0x2642
/*
@@ -1808,7 +1821,8 @@
PRINT 0x274d 0x274f - 0x2752 0x2756 0x2758 - 0x275e 0x2761 - 0x2794
PRINT 0x2798 - 0x27af 0x27b1 - 0x27be
SPECIAL 0x2776 - 0x2793
-SWIDTH1 0x2701 - 0x2704 0x2706 - 0x2709 0x270c - 0x2727 0x2729 - 0x274b
+SWIDTH1 0x2701 - 0x2704 0x2706 - 0x2709 0x270c - 0x2727 0x2729 - 0x273c 0x273e - 0x274b
+SWIDTH2 0x273d
SWIDTH1 0x274d 0x274f - 0x2752 0x2756 0x2758 - 0x275e 0x2761 - 0x2794
SWIDTH1 0x2798 - 0x27af 0x27b1 - 0x27be
@@ -2095,7 +2109,8 @@
GRAPH 0xe000 - 0xf8ff
PRINT 0xe000 - 0xf8ff
-SWIDTH1 0xe000 - 0xf8ff
+SWIDTH1 0xf6b1 - 0xf8ff
+SWIDTH2 0xe000 - 0xf6b0
/*

View File

@ -0,0 +1,10 @@
Unicode define some character width as ambigious. Software determines
the width of characters accroding the context. However, sometimes it is
hard or impossible to know the context. Thus, this port dirty fixes some
console software, let them recognize all characters in Big5 encoding
range as double width. Now you will be happy with UTF8 terminal and
Big5 fonts :)
This port fixes the zh_TW.UTF-8 locale for wcwidth(3) and wcswidth(3).
WWW: http://www.csie.ntu.edu.tw/~r92030/project/big5width/

View File

@ -0,0 +1,5 @@
==
Because FreeBSD's installworld target cleans all locale
stuffs up, you'll need to reinstall the port after every
installworld operations.
==

View File

@ -0,0 +1,5 @@
share/locale/%%LANG%%/LC_CTYPE
@unexec rm -f %%BASELOCALEDIR%%/%%LANG%%/LC_CTYPE; mv -f %D/share/locale/%%LANG%%/LC_CTYPE.old %%BASELOCALEDIR%%/%%LANG%%/LC_CTYPE
@dirrm share/locale/%%LANG%%
@dirrmtry share/locale
@exec cp -p %%BASELOCALEDIR%%/%%LANG%%/LC_CTYPE %D/share/locale/%%LANG%%/LC_CTYPE.old; ln -sf %D/share/locale/%%LANG%%/LC_CTYPE %%BASELOCALEDIR%%/%%LANG%%/LC_CTYPE