CO, CBO, HO and HBO fonts don't work If you select one of these font, you got ERROR in koha-conf.xml -- missing <font type="HBOO">/path/to/font.ttf</font> at /home/koha/src/C4/Creators/PDF.pm line 123ERROR in koha-conf.xml -- missing <font type="HBOO">/path/to/font.ttf</font> at /home/koha/src/C4/Creators/PDF.pm line 123 in Koha logs. see bug 8375 comment 83 and following.
Created attachment 30217 [details] [review] Bug 12194 - add more tests for pdf creation When run with KEEP_PDF enviroment variable it will keep test.pdf for manual inspection. This can be used to verify that ttf font configuration is complete like: KEEP_PDF=1 KOHA_CONF=/etc/koha/sites/srvgit/koha-conf.xml prove t/Creators.t sample of utf-8 text, font name and type will be on bottom of second page
I can't reproduce this. I can only suspect that you are really missing all ttf definitions in koha-conf.xml, so I expanded this test to verify that all fonts are available on system. Can you give it a try?
After reading comments on bug 8375, I see what the problem is, so I will prepare patch for it.
I ran this test, and discovered that I was missing HO in my koha-conf.xml file. <font type="HO" >/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Oblique.ttf</font> Added this line in, and the tests all passed. Without it, they failed loudly.
Created attachment 40702 [details] [review] Bug 12194: Add option 'Oblique title' in labels This patch adds a checkbox on Label creator to use or not an oblique variant of main font for title Also fix font selection for title in case an oblique variant is used. To test: Before patch 1) Go to Tools > Label creator 2) Create a new layout, default values but select any 'Oblique' variant for main font and 'Biblio/Barcode' for layout type 3) Go to Manage batches, create a batch, add items, export PDF, download 4) Check logs, you must find a line with 'ERROR in koha-conf.xml -- missing <font type="COO">' for example if main font Courier-Oblique 5) Open PDF, title could be right but not using selected font After patch 6) Apply the patch 7) Run updatedatabase.pl 8) Repeat 1-2, note new checkbox 'Oblique title', default checked 9) Repeat export, no new warnings on log 10) Create a new layout or edit an existent one, uncheck 'Oblique title', save, export again Check PDF has non slanted title
First patch works, mine adds a possible solution to make all fonts work.
Does not apply: CONFLICT (content): Merge conflict in t/Creators.t Failed to merge in the changes. Patch failed at 0001 Bug 12194 - add more tests for pdf creation
Created attachment 43697 [details] [review] Bug 12194 - add more tests for pdf creation When run with KEEP_PDF enviroment variable it will keep test.pdf for manual inspection. This can be used to verify that ttf font configuration is complete like: KEEP_PDF=1 KOHA_CONF=/etc/koha/sites/srvgit/koha-conf.xml prove t/Creators.t sample of utf-8 text, font name and type will be on bottom of second page
Created attachment 43698 [details] [review] Bug 12194: Add option 'Oblique title' in labels This patch adds a checkbox on Label creator to use or not an oblique variant of main font for title Also fix font selection for title in case an oblique variant is used. To test: Before patch 1) Go to Tools > Label creator 2) Create a new layout, default values but select any 'Oblique' variant for main font and 'Biblio/Barcode' for layout type 3) Go to Manage batches, create a batch, add items, export PDF, download 4) Check logs, you must find a line with 'ERROR in koha-conf.xml -- missing <font type="COO">' for example if main font Courier-Oblique 5) Open PDF, title could be right but not using selected font After patch 6) Apply the patch 7) Run updatedatabase.pl 8) Repeat 1-2, note new checkbox 'Oblique title', default checked 9) Repeat export, no new warnings on log 10) Create a new layout or edit an existent one, uncheck 'Oblique title', save, export again Check PDF has non slanted title
Patches rebased, conflicts with bug 14602 fixed.
To make it work, I had to - update the database (obvious, but not in test plan) - copy the font definitions from etc/koha-conf.xml to my own koha-conf.xml - then I had a lot of warnings like "ERROR in koha-conf.xml -- missing <font type="Ft1">/path/to/font.ttf</font>", they vanished after applying Bug 14468 - Remove warnings when creating Labels Idea for a separate bug: On the About page > System warnings we have a section about errors in koha-conf.xml, we could add there a sanity check for font definitions.
Created attachment 43699 [details] [review] Bug 12194 - add more tests for pdf creation When run with KEEP_PDF enviroment variable it will keep test.pdf for manual inspection. This can be used to verify that ttf font configuration is complete like: KEEP_PDF=1 KOHA_CONF=/etc/koha/sites/srvgit/koha-conf.xml prove t/Creators.t sample of utf-8 text, font name and type will be on bottom of second page Followed test plan, works as expected. (See comment#11) Signed-off-by: Marc Véron <veron@veron.ch>
Created attachment 43700 [details] [review] Bug 12194: Add option 'Oblique title' in labels This patch adds a checkbox on Label creator to use or not an oblique variant of main font for title Also fix font selection for title in case an oblique variant is used. To test: Before patch 1) Go to Tools > Label creator 2) Create a new layout, default values but select any 'Oblique' variant for main font and 'Biblio/Barcode' for layout type 3) Go to Manage batches, create a batch, add items, export PDF, download 4) Check logs, you must find a line with 'ERROR in koha-conf.xml -- missing <font type="COO">' for example if main font Courier-Oblique 5) Open PDF, title could be right but not using selected font After patch 6) Apply the patch 7) Run updatedatabase.pl 8) Repeat 1-2, note new checkbox 'Oblique title', default checked 9) Repeat export, no new warnings on log 10) Create a new layout or edit an existent one, uncheck 'Oblique title', save, export again Check PDF has non slanted title Followed test plan, works as expected. (See comment #11). Signed-off-by: Marc Véron <veron@veron.ch>
Created attachment 43737 [details] [review] Bug 12194 - add more tests for pdf creation When run with KEEP_PDF enviroment variable it will keep test.pdf for manual inspection. This can be used to verify that ttf font configuration is complete like: KEEP_PDF=1 KOHA_CONF=/etc/koha/sites/srvgit/koha-conf.xml prove t/Creators.t sample of utf-8 text, font name and type will be on bottom of second page Followed test plan, works as expected. (See comment#11) Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 43738 [details] [review] Bug 12194: Add option 'Oblique title' in labels This patch adds a checkbox on Label creator to use or not an oblique variant of main font for title Also fix font selection for title in case an oblique variant is used. To test: Before patch 1) Go to Tools > Label creator 2) Create a new layout, default values but select any 'Oblique' variant for main font and 'Biblio/Barcode' for layout type 3) Go to Manage batches, create a batch, add items, export PDF, download 4) Check logs, you must find a line with 'ERROR in koha-conf.xml -- missing <font type="COO">' for example if main font Courier-Oblique 5) Open PDF, title could be right but not using selected font After patch 6) Apply the patch 7) Run updatedatabase.pl 8) Repeat 1-2, note new checkbox 'Oblique title', default checked 9) Repeat export, no new warnings on log 10) Create a new layout or edit an existent one, uncheck 'Oblique title', save, export again Check PDF has non slanted title Followed test plan, works as expected. (See comment #11). Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 43739 [details] [review] Bug 12194: Add change to kohastructure.sql Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 43740 [details] [review] Bug 12194: fix label for oblique_title Bug 12194: fix label for oblique_title Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Patches pushed to master. Thanks Dobrica, Bernardo and Joanthan!
Patch authors: please check that tests are failing due to this patchset: prove t/db_dependent/Labels/* Might not be the only tests failing, so please check jenkins (D7 is fine)
Created attachment 43778 [details] [review] Bug 12194: followup to fix test This patch adds new column 'oblique_title' to tested data structure, and update number of tests To test: 1) Run prove t/db_dependent/Labels/*, or specifically prove t/db_dependent/Labels/t_Layout.t It fails 2) apply the patch 3) Run test again, this time must pass
Added followup, needs revision i think, so changed to Needs signoff
Created attachment 43801 [details] [review] Bug 12194: followup to fix test This patch adds new column 'oblique_title' to tested data structure, and update number of tests To test: 1) Run prove t/db_dependent/Labels/*, or specifically prove t/db_dependent/Labels/t_Layout.t It fails 2) apply the patch 3) Run test again, this time must pass Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Followup pushed to master. Thanks for taking care, Bernardo!