google-code-export / tovid

Automatically exported from code.google.com/p/tovid
1 stars 0 forks source link

todiscgui-svn-r2382 x ImageMagick-6.3.5.10-2 in openSUSE 10.3: combo-boxes for fonts menus are retrieving wrong fonts. #22

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

 I'm testing todiscgui-svn-r2382 out in my openSUSE 10.3 GNU/Linux box and
I've installed ImageMagick-6.3.5.10-2. When I trying out select another
font than 'Helvetica', I got these 'fonts' to be chosen at font combo-boxes:

Bilevel
ColorSeparation
ColorSeparationMatte
Grayscale
GrayscaleMatte
Optimize
Palette
PaletteBilevelMatte
PaletteMatte
TrueColorMatte
TrueColor

which are resulting from 'convert -list type' and obviously aren't the
fonts installed.

Now, if I type 'convert -list font', I got the the correct list from
installed fonts:

Andale-Sans-Bold-Italic          Andale Sans            Italic  Normal    
  700
Andale-Sans-Italic               Andale Sans            Italic  Normal    
  400
Andale-Sans-Regular              Andale Sans            Normal  Normal    
  400
Andy-MT-Bold                     Andy MT                Normal  Normal    
  700
Andy-MT-Regular                  Andy MT                Normal  Normal    
  400
Angelina-Regular                 Angelina               Normal  Normal    
  400
Anglepoise-Lampshade-Regular     Anglepoiseampshade     Normal  Normal    
  400
Anglo-Text-Regular               Anglo Text             Normal  Normal    
  400
Anklepants-Regular               Anklepants             Normal  Normal    
  400
Another-Typewriter-Regular       Another Typewriter     Normal  Normal    
  400
Ardenwood-Demo-Regular           Ardenwood Demo         Normal  Normal    
  400
Arial-Black-Itálico             Arial Black            Italic  Normal       400
Arial-Black-Normal               Arial Black            Normal  Normal    
  400
Arial-Black-Regular              Arial Black            Normal  Normal    
  400
Arial-Itálico                   Arial                  Italic  Normal       400
Arial-Narrow-Itálico            Arial Narrow           Italic  Condensed    400
Arial-Narrow-Negrito             Arial Narrow           Normal  Condensed 
  700
Arial-Narrow-Negrito-Itálico    Arial Narrow           Italic  Condensed    700
Arial-Narrow-Normal              Arial Narrow           Normal  Condensed 
  400
Arial-Negrito                    Arial                  Normal  Normal    
  700
Arial-Negrito-Itálico           Arial                  Italic  Normal       700
Arial-Normal                     Arial                  Normal  Normal    
  400
Arial-Unicode-MS-Normal          Arial Unicode MS       Normal  Normal    
  400
Army-of-Darkness-Italic          Army of Darkness       Italic  Normal    
  400
Army-of-Darkness-Regular         Army of Darkness       Normal  Normal    
  400
Arnprior-Regular                 Arnprior               Normal  Normal    
  400
Ashley-Regular                   Ashley                 Normal  Normal    
  100
Astron-Boy-Italic                Astron Boy             Italic  Normal    
  400
Astron-Boy-Regular               Astron Boy             Normal  Normal    
  400
Astron-Boy-Video-Regular         Astron Boy Video       Normal  Normal    
  400
Astron-Boy-Wonder-Regular        Astron Boy Wonder      Normal  Normal    
  400
augie-Regular                    augie                  Normal  Normal    
  400
Axaxax--regular                  Axaxax                 Normal  Normal    
  400
Baby-Jeepers-Regular             Baby Jeepers           Normal  Normal    
  400
BaileysCar-Regular               BaileysCar             Normal  Normal    
  400
Balker-Regular                   Balker                 Normal  Normal    
  400
Baltar-Regular                   Baltar                 Normal  Normal    
  400
BankGothic-Md-BT-Medium          BankGothic Md BT       Normal  SemiExpan 
  400
Barbatrick-Regular               Barbatrick             Normal  Normal    
  400
Baveuse-3D-Regular               Baveuse 3D             Normal  Normal    
  400
Baveuse-Regular                  Baveuse                Normal  Normal    
  400
Beat-My-Guest-Regular            Beat My Guest          Normal  Normal    
  400
Bell-MT-Bold                     Bell MT                Normal  Normal    
  700
Bell-MT-Bold-Italic              Bell MT                Italic  Normal    
  700
Bell-MT-Italic                   Bell MT                Italic  Normal    
  400
Bell-MT-Regular                  Bell MT                Normal  Normal    
  400
Bert-Regular                     Bert                   Normal  Normal    
  100
Berylium-Bold                    Berylium               Normal  Normal    
  700
Berylium-Bold-Italic             Berylium               Italic  Normal    
  700
Berylium-Italic                  Berylium               Italic  Normal    
  400
Berylium-Regular                 Berylium               Normal  Normal    
  400
Betsy-Flanagan-Regular           Betsy Flanagan         Normal  Normal    
  400
Biting-My-Nails-Outline-Regular  Biting My Nails Outlin Normal  Normal    
  400
Biting-My-Nails-Regular          Biting My Nails        Normal  Normal    
  400
Bitstream-Charter-Bold           Bitstream Charter      Normal  Normal    
  700
Bitstream-Charter-Bold-Italic    Bitstream Charter      Italic  Normal    
  700
Bitstream-Charter-Italic         Bitstream Charter      Italic  Normal    
  400
Bitstream-Charter-Regular        Bitstream Charter      Normal  Normal    
  400
Blue-Highway-Bold                Blue Highway           Normal  Normal    
  700
Blue-Highway-Condensed-Regular   Blue Highway Condensed Normal  Normal    
  400
Blue-Highway-D-Type-Regular      Blue Highway D Type    Normal  Normal    
  400
Blue-Highway-Linocut-Regular     Blue Highwayinocut     Normal  Normal    
  400
Blue-Highway-Regular             Blue Highway           Normal  Normal    
  400
Bodoni-MT-Black                  Bodoni MT              Normal  Normal    
  900
Bodoni-MT-Condensed              Bodoni MT              Normal  Condensed 
  400
Bodoni-MT-Itálico               Bodoni MT              Italic  Normal       900
Bodoni-MT-Negrito                Bodoni MT              Normal  Normal    
  700
Bodoni-MT-Negrito-Itálico       Bodoni MT              Italic  Normal       700
Bodoni-MT-Normal                 Bodoni MT              Normal  Normal    
  400
Borg9-Regular                    Borg9                  Normal  Normal    
  400
Boron-Regular                    Boron                  Normal  Normal    
  400
BrockScript-Regular              BrockScript            Normal  Normal    
  400
Budmo-Jiggler--Bold              Budmo Jiggler          Normal  Normal    
  700
Budmo-Jiggler-Regular            Budmo Jiggler          Normal  Normal    
  400
Bullpen-3D-Regular               Bullpen 3D             Normal  Normal    
  400
Bullpen-Italic                   Bullpen                Italic  Normal    
  400
Bullpen-Regular                  Bullpen                Normal  Normal    
  400
Burnstown-Dam-Regular            Burnstown Dam          Normal  Normal    
  400
Butterbelly-Regular              Butterbelly            Normal  Normal    
  400
Caddy-Regular                    Caddy                  Normal  Normal    
  400
Calligrapher-Regular             Calligrapher           Normal  Normal    
  100
Carbon-Block-Regular             Carbon Block           Normal  Normal    
  400
Carbon-Phyber-Regular            Carbon Phyber          Normal  Normal    
  400
Century-Schoolbook-Bold          Century Schoolbook     Normal  Normal    
  700
Century-Schoolbook-Bold-Italic   Century Schoolbook     Italic  Normal    
  700
Century-Schoolbook-Italic        Century Schoolbook     Italic  Normal    
  400
Century-Schoolbook-normal        Century Schoolbook     Normal  Normal    
  400
Century-Schoolbook-Roman         Century Schoolbook     Normal  Normal    
  500
Charles-in-Charge-Regular        Charles in Charge      Normal  Normal    
  400
China-Regular                    China                  Normal  Normal    
  400
Chinese-Rocks-Regular            Chinese Rocks          Normal  Normal    
  400
cmex10-Medium                    cmex10                 Normal  Normal    
  500
cmmi10-Medium                    cmmi10                 Normal  Normal    
  500
cmr10-Medium                     cmr10                  Normal  Normal    
  500
cmsy10-Medium                    cmsy10                 Normal  Normal    
  500
Colourbars-Bold                  Colourbars             Normal  Normal    
  700
Colourbars-Regular               Colourbars             Italic  Normal    
  400
Comic-Sans-MS-Negrito            Comic Sans MS          Normal  Normal    
  700

So I think that the file configs.py into gui subdirectory must be modified
in order to take into account the current version of ImageMagick.

JFYI.

Regards,

Danilo (aka 'danpos')

Original issue reported on code.google.com by dan...@gmail.com on 6 Nov 2007 at 11:38

GoogleCodeExporter commented 9 years ago
I think that I've fixed the issue: take a look at utils.py, we have:

def imagemagick_version():
    """Return the version of ImageMagick that's currently installed,
    as a dotted string of numbers (e.g. '6.3.5.10').
    """
    command = 'convert -list configure | grep ^LIB_VERSION_NUMBER'
    lines = os.popen(command).readlines()
    return lines[0].split()[1].replace(',', '')

def get_listtype():
    """Return argument for finding ImageMagick's list of fonts,
    based on the version of IM installed.
    """
    if imagemagick_version() >= '6357':
            listarg = 'font'
    else:
            listarg = 'type'
    return listarg

The code is very well commented, so I pay attention to these words:

"...dotted string of numbers (e.g. '6.3.5.10')."

So I saw that the line:

if imagemagick_version() >= '6357':

isn't using the correct expression (typos for sure) because are missing the 
'dots';
so I've just changed the line to:

if imagemagick_version() >= '6.3.5.7':

and so todiscgui is now working correctly.

JFYI.

Regards,

Original comment by dan...@gmail.com on 7 Nov 2007 at 12:10

GoogleCodeExporter commented 9 years ago
The bug is that I didn't allow for a LIB_VERSION_NUMBER where the last field is 
greater than 9, so your IM version is returning 63510

Your solution of changing it to decimals is not going to help as 6.3.5.7 is not 
amenable to the type of comparison we are doing.  The doc string was just an 
omission  - I didn't change the doc string from the original fuction when I 
made my 
first changes.

Wapcaplet has commited an solution to svn that leaves the commas and uses list 
comparison, which seems to me to be quite elegant.
svn up and thanks for the bug report :)

grepper

Original comment by grepper@gmail.com on 7 Nov 2007 at 4:42

GoogleCodeExporter commented 9 years ago

Original comment by grepper@gmail.com on 7 Nov 2007 at 4:52