From owner-freebsd-questions@FreeBSD.ORG Sun Dec 14 19:00:26 2008 Return-Path: Delivered-To: FreeBSD-questions@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 597E01065676 for ; Sun, 14 Dec 2008 19:00:26 +0000 (UTC) (envelope-from nikola.lecic@anthesphoria.net) Received: from anthesphoria.net (anthesphoria.net [200.46.204.219]) by mx1.freebsd.org (Postfix) with ESMTP id 0AAC88FC12 for ; Sun, 14 Dec 2008 19:00:25 +0000 (UTC) (envelope-from nikola.lecic@anthesphoria.net) X-Bogosity: No, tests=bogofilter X-DKIM: Sendmail DKIM Filter v2.4.1 anthesphoria.net mBEJ0IlZ024844 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anthesphoria.net; s=phero; t=1229281224; bh=Z6W7SbGYHj+bFf0Axu8oXDq8a3Nh988liC+fRiOvi Bw=; l=3256; h=X-Bogosity:Date:From:To:Cc:Subject:Message-ID: In-Reply-To:References:X-Mailer:X-Face:X-Operating-System: X-OpenPGP-Fingerprint:X-OpenPGP-Preferred-Keyserver:Mime-Version: Content-Type:Content-Transfer-Encoding; b=VVgY+qBq0xsMxfOCLP7lwu0L peAI714WQmD/7h8BIKRgBjl1tfjnmPjQZsfR6nOcLxbT6LiIQ3xUV48C1nsBM94jtFG kme+g/h7Bn3tQzTdHoi3frr6vZMLy3ojTae6/ktkXDesMJMrXZQK2NNmun1E6QKJIVT fBMZ1J/pTtYcg= Received: from anthesphoria.net (adsl-200-199.eunet.yu [213.198.200.199]) (authenticated bits=0) by anthesphoria.net (8.14.2/8.14.2) with ESMTP id mBEJ0IlZ024844 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 14 Dec 2008 20:00:22 +0100 (CET) (envelope-from nikola.lecic@anthesphoria.net) Date: Sun, 14 Dec 2008 19:56:15 +0100 From: Nikola =?UTF-8?B?TGXEjWnEhw==?= To: cuongvt Message-ID: <20081214195615.383462e3@anthesphoria.net> In-Reply-To: <20997257.post@talk.nabble.com> References: <20997257.post@talk.nabble.com> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.11; i386-portbld-freebsd7.1) X-Face: pbl6-.[$G'Fi(Ogs2xlXP-V6{3||$Y[LOYs&~GJoikj'cVjcFC[V7du;;0~6nO= [Vi2?uU1Pq~,=Adj@,T:|"`$AF~il]J.Nz#2pU',Y7.{B;m/?{#sO^Dvo$rnmY6] X-Operating-System: FreeBSD 7.0-RELEASE/i386 X-OpenPGP-Fingerprint: FEF3 66AF C90E EDC3 D878 7CDC 956D F4AB A377 1C9B X-OpenPGP-Preferred-Keyserver: x-hkp://pgpkeys.pca.dfn.de Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: FreeBSD-questions@FreeBSD.org Subject: Re: imagemagick convert: japanese text broken in freebsd X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2008 19:00:26 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: RIPEMD160 On Sat, 13 Dec 2008 20:20:23 -0800 (PST) cuongvt wrote: > Hi, > I know that IM support japanese text. > On Freebsd 7.0 with latest imagemagick built from port (6.4.7) and > msgothic.ttc copied from windows partition, > imagick extension of PHP installed by pecl. > in terminal (zsh) I type: > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > convert origin.jpg -fill white -font > /usr/X11R6/lib/X11/fonts/TrueType/msgothic.ttc -pointsize 125 -stroke > blue -strokewidth 1 -draw "text 20,130 '=E3=81=8C=E3=81=8F=E3=81=9B=E3=81= =84'" straight.jpg > =3D=3D=3D=3D=3D=3D=3D=3D > IM did not informed any error, but the result is japanese text broken > (question marks). Hello, It works for me with ImageMagick-6.4.5.5 and ImageMagick-6.4.7.5. First, please make sure that the cause of the problem is not something simple, i.e. make sure that a) you don't have a wrong /non-UTF-8/ locale (not very likely since you wouldn't get question marks); b) you compiled ImageMagick with IMAGEMAGICK_TTF and IMAGEMAGICK_FONTCONFIG. If these are the case, then it's almost certain that fontconfig is somehow confused with that Microsoft font. For example, see this thread on XeTeX mailing list about Microsoft YaHei font: http://www.tug.org/pipermail/xetex/2007-May/006539.html If you use -text directive without -font specified, ImageMagick will use the fonts from /usr/local/lib/ImageMagick-6.4.7/config/type-ghostscript.xml and this will produce question marks with Japanese UTF-8 string, which seems to be the case. So, if you don't want to use some free non-Microsoft font, you can try to do this: 1) Regenerate fontconfig cache ('fc-cache -f -v' as root). 2) Check if MS Gothic is visible to ImageMagick, i.e. try %convert -list font The output should contain Font: =EF=BC=AD=EF=BC=B3-=E3=82=B4=E3=82=B7=E3=83=83=E3=82=AF-=E6=A8= =99=E6=BA=96 family: =EF=BC=AD=EF=BC=B3 =E3=82=B4=E3=82=B7=E3=83=83=E3=82=AF style: Normal stretch: Normal weight: 400 glyphs: /path/to/msgothic.ttc in ja_JP.UTF-8, or Font: MS-Gothic-Regular family: MS Gothic in en_US.UTF-8 locale. 3) Then try %convert orig.jpg -font =EF=BC=AD=EF=BC=B3-=E3=82=B4=E3=82=B7=E3=83= =83=E3=82=AF-=E6=A8=99=E6=BA=96 -verbose -fill white \ -pointsize 125 -stroke blue -strokewidth 1 \ -draw "text 20,130 '=E3=81=8C=E3=81=8F=E3=81=9B=E3=81=84'" straigh= t.jpg if you use ja_JP.* locale (-font MS-Gothic-Regular if you use en_US.UTF-8 -- note that the command is locale-sensitive) and see if this makes any difference. Best regards. - --=20 Nikola Le=C4=8Di=C4=87 =3D =D0=9D=D0=B8=D0=BA=D0=BE=D0=BB=D0=B0 =D0=9B=D0= =B5=D1=87=D0=B8=D1=9B fingerprint : FEF3 66AF C90E EDC3 D878 7CDC 956D F4AB A377 1C9B ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) iJwEAQEDAAYFAklFVtMACgkQ/MM/0rYIoZin4wP/Zhlf++1GS8jWitrcT0wq0Rkr cROjjb0DOusXnZnq9LdWac3kjOv5mAUENu7jVy+9rGqvmGhDFkgBi4/mBrcSePGv cTzSMqsWAeeF+JTizyqJCyRjaz2iOuEjQ1y6zvkOj5D9EE+udXmR6BE7u3HdgZKL mknYg8Y4ARyu1N+tiOw=3D =3DW84X -----END PGP SIGNATURE-----