From: <nic...@ne...> - 2005-02-22 08:27:35
|
Hi Alex, Thanks for the patch --- I tried it and it does fix the problems: the cyrillic text appears correctly in the .dot file. One remaining issue for me is that the cyrillic is not rasterized properly by =22dot -Tpng=22 with the FreeSans font which is specified by default. It works with Arial, though, it this may be something to do with my system. = So please include the patch -- thanks again for looking into this. - Nicolas >On Sun, Feb 20, 2005 at 09:45:38AM +0000, nickberger=40netcourrier.com wr= ote: >> = >> <code> (RelGraph.py lines 827-832) >> if fontname =3D=3D =5FTT=5FFONT: >> file.write('label=3D=22%s=22 ' % >> string.replace(label, '=22', r'=5C=22')) >> else: >> file.write('label=3D=22%s=22 ' % >> utf8=5Fto=5Flatin(string.replace(label, '=22', r'=5C= =22'))) >> </code> >> = >> But when I dump the fontname used for the cyrillic labels, this is = >> always =22=22 for some reason, so the first case never occurs and = >> utf8=5Fto=5Flatin is always used... >> = >> In fact fontname is an argument of the function =5FwriteNode which = >> contains this code, and there seem to be several calls to =5FwriteNode >> with no value given to fontname (=22=22 is default). There are also cal= ls >> with self.FontStyle given as argument, which should be correct, but = >> not all calls specify it. >> = >> Maybe I'm missing something but this seems to be a bug -- it prevents >> cyrillic output for both the TrueType and PostScipt settings. = >> If I remove the utf8=5Fto=5Flatin() call by hand, the output is correct= , >> with cyrillic characters instead of ?????. > >I think you are right in your analysis. I would do two things here: > >1. Turn around the logic, so that the check is made for PS font, > and only then utf=5Fto=5Flatin encode the labels. This way > the default would be to leave things alone (whether the TT or nothing > is specified). > >2. Always specify the font style given to =5FwriteNode function. > >I am attaching the patch, please let me know if it makes you happy. >If you have no problem, this will be committed to CVS and appear >in the 1.0.11 release, expected in a few days. > >Alex > >-- = >Alexander Roitman http://ebner.neuroscience.umn.edu/people/alex.html >Dept. of Neuroscience, Lions Research Building >2001 6th Street SE, Minneapolis, MN 55455 >Tel (612) 625-7566 FAX (612) 626-9201 > ------------------------------------------------------------- NetCourrier, votre bureau virtuel sur Internet : Mail, Agenda, Clubs, Tool= bar... Web/Wap : www.netcourrier.com T=E9l=E9phone/Fax : 08 92 69 00 21 (0,34 =80 TTC/min) Minitel: 3615 NETCOURRIER (0,16 =80 TTC/min) |