In Koha-conf.xml, the font paths for the DejaVu fonts are hardcoded. Unfortunately, the paths don't match the installed font locations in other distributions (such as Fedora). Ideally, the system should enquire of fontconfig where the fonts are installed. Something like: fc-list : file | grep Deja spits out the correct paths, and should work across distributions. Just spent quite a long time trying to figure out why the Creators.t test was continually failing during make test even though they ran fine manually. Problem seems to have been this!
It's not in perl, but the following bash snippet (hacky, but works!) could set the proper paths... #!/bin/bash tr=$(fc-list : file | grep DejaVuSerif.ttf) tb=$(fc-list : file | grep DejaVuSerif-Bold.ttf) ti=$(fc-list : file | grep DejaVuSerif-Italic.ttf) tbi=$(fc-list : file | grep DejaVuSerif-BoldItalic.ttf) c=$(fc-list : file | grep DejaVuSansMono.ttf) cb=$(fc-list : file | grep DejaVuSansMono-Bold.ttf) co=$(fc-list : file | grep DejaVuSansMono-Oblique.ttf) cbo=$(fc-list : file | grep DejaVuSansMono-BoldOblique.ttf) h=$(fc-list : file | grep DejaVuSans.ttf) ho=$(fc-list : file | grep DejaVuSans-Oblique.ttf) hb=$(fc-list : file | grep DejaVuSans-Bold.ttf) hbo=$(fc-list : file | grep DejaVuSans-BoldOblique.ttf) echo "<font type=\"TR\" >${tr%??}</font>" echo "<font type=\"TB\" >${tb%??}</font>" echo "<font type=\"TI\" >${ti%??}</font>" echo "<font type=\"TBI\" >${tbi%??}</font>" echo "<font type=\"C\" >${c%??}</font>" echo "<font type=\"CB\" >${cb%??}</font>" echo "<font type=\"CO\" >${co%??}</font>" echo "<font type=\"CBO\" >${cbo%??}</font>" echo "<font type=\"H\" >${h%??}</font>" echo "<font type=\"HO\" >${ho%??}</font>" echo "<font type=\"HB\" >${hb%??}</font>" echo "<font type=\"HBO\" >${hbo%??}</font>"
Created attachment 45897 [details] [review] Allows selecting the path for fonts at installation time Allows for selection of DejaVu font path when installing from the command line. This is useful for non-debian distributions that don't store the fonts in the same place. Adds a new configuration variable to Makefile.PL: FONT_DIR Defaults to the Debian install location for the fonts. Test plan: 1. Run a CLI install, accepting the defaults. 2. Compare the generated koha-conf.xml to a previous install - the font path for DejaVu fonts should be the same. 3. Run another CLI install, this time choosing a custom path for the fonts 4. Check that the path selected is reflected in the koha-conf.xml file.
Created attachment 48037 [details] [review] [SIGNED-OFF] Bug 12549 - Hard coded font Paths ( DejaVu ) cause problems for non-Debian systems Allows for selection of DejaVu font path when installing from the command line. This is useful for non-debian distributions that don't store the fonts in the same place. Adds a new configuration variable to Makefile.PL: FONT_DIR Defaults to the Debian install location for the fonts. Test plan: 1. Run a CLI install, accepting the defaults. 2. Compare the generated koha-conf.xml to a previous install - the font path for DejaVu fonts should be the same. 3. Run another CLI install, this time choosing a custom path for the fonts 4. Check that the path selected is reflected in the koha-conf.xml file. NOTE: 'perl Makefile.pl' and 'make' generates blib/KOHA_CONF_DIR/koha-conf.xml ran with a weird string for the font dir copied that koha-conf.xml to my home dir reran with all defaults compared the two, and only the font paths differed. Also, I cleaned up the tabs that snuck in. :) Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
I don't know if we should update debian/templates/koha-conf-site.xml.in as weel, to keep both files in sync.
Created attachment 48118 [details] [review] Bug 12549: Hard coded font Paths ( DejaVu ) cause problems for non-Debian systems Allows for selection of DejaVu font path when installing from the command line. This is useful for non-debian distributions that don't store the fonts in the same place. Adds a new configuration variable to Makefile.PL: FONT_DIR Defaults to the Debian install location for the fonts. Test plan: 1. Run a CLI install, accepting the defaults. 2. Compare the generated koha-conf.xml to a previous install - the font path for DejaVu fonts should be the same. 3. Run another CLI install, this time choosing a custom path for the fonts 4. Check that the path selected is reflected in the koha-conf.xml file. NOTE: 'perl Makefile.pl' and 'make' generates blib/KOHA_CONF_DIR/koha-conf.xml ran with a weird string for the font dir copied that koha-conf.xml to my home dir reran with all defaults compared the two, and only the font paths differed. Also, I cleaned up the tabs that snuck in. :) Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Created attachment 48119 [details] [review] Bug 12549: (QA followup) missing newline in CLI dialog Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
I don't think is necessary to add placeholders for font path into the packages template right now. In the mid term the packages-way should be integrated into the source install so we should have a single file to maintain.
Pushed to Master - Should be in the May 2016 release. Thanks
Patches pushed to 3.22.x, will be in 3.22.4
This patch has been pushed to 3.20.x, will be in 3.20.9.