Bug 12194 - Some fonts don't work on printing label
Summary: Some fonts don't work on printing label
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Label/patron card printing (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Dobrica Pavlinusic
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-06 13:30 UTC by Jonathan Druart
Modified: 2016-06-21 21:40 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 12194 - add more tests for pdf creation (2.21 KB, patch)
2014-07-28 15:40 UTC, Dobrica Pavlinusic
Details | Diff | Splinter Review
Bug 12194: Add option 'Oblique title' in labels (10.67 KB, patch)
2015-06-28 03:28 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
Bug 12194 - add more tests for pdf creation (2.29 KB, patch)
2015-10-21 15:08 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 12194: Add option 'Oblique title' in labels (10.68 KB, patch)
2015-10-21 15:08 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 12194 - add more tests for pdf creation (2.48 KB, patch)
2015-10-21 17:18 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 12194: Add option 'Oblique title' in labels (10.87 KB, patch)
2015-10-21 17:19 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 12194 - add more tests for pdf creation (2.54 KB, patch)
2015-10-22 07:58 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 12194: Add option 'Oblique title' in labels (10.94 KB, patch)
2015-10-22 07:58 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 12194: Add change to kohastructure.sql (1022 bytes, patch)
2015-10-22 07:58 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 12194: fix label for oblique_title (1.37 KB, patch)
2015-10-22 07:59 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 12194: followup to fix test (1.49 KB, patch)
2015-10-22 18:32 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
Bug 12194: followup to fix test (1.56 KB, patch)
2015-10-23 07:17 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2014-05-06 13:30:13 UTC
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.
Comment 1 Dobrica Pavlinusic 2014-07-28 15:40:25 UTC Comment hidden (obsolete)
Comment 2 Dobrica Pavlinusic 2014-07-28 15:42:35 UTC
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?
Comment 3 Dobrica Pavlinusic 2014-07-28 16:25:38 UTC
After reading comments on bug 8375, I see what the problem is, so I will prepare patch for it.
Comment 4 M. Tompsett 2014-08-28 20:24:45 UTC
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.
Comment 5 Bernardo Gonzalez Kriegel 2015-06-28 03:28:30 UTC Comment hidden (obsolete)
Comment 6 Bernardo Gonzalez Kriegel 2015-06-28 03:30:18 UTC
First patch works, mine adds a possible solution to make all fonts work.
Comment 7 Marc Véron 2015-10-20 19:04:00 UTC
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
Comment 8 Jonathan Druart 2015-10-21 15:08:23 UTC Comment hidden (obsolete)
Comment 9 Jonathan Druart 2015-10-21 15:08:27 UTC Comment hidden (obsolete)
Comment 10 Jonathan Druart 2015-10-21 15:08:59 UTC
Patches rebased, conflicts with bug 14602 fixed.
Comment 11 Marc Véron 2015-10-21 17:13:41 UTC
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.
Comment 12 Marc Véron 2015-10-21 17:18:38 UTC Comment hidden (obsolete)
Comment 13 Marc Véron 2015-10-21 17:19:47 UTC Comment hidden (obsolete)
Comment 14 Jonathan Druart 2015-10-22 07:58:33 UTC
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>
Comment 15 Jonathan Druart 2015-10-22 07:58:36 UTC
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>
Comment 16 Jonathan Druart 2015-10-22 07:58:40 UTC
Created attachment 43739 [details] [review]
Bug 12194: Add change to kohastructure.sql

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 17 Jonathan Druart 2015-10-22 07:59:04 UTC
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>
Comment 18 Tomás Cohen Arazi 2015-10-22 13:49:42 UTC
Patches pushed to master.

Thanks Dobrica, Bernardo and Joanthan!
Comment 19 Tomás Cohen Arazi 2015-10-22 18:02:10 UTC
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)
Comment 20 Bernardo Gonzalez Kriegel 2015-10-22 18:32:50 UTC Comment hidden (obsolete)
Comment 21 Bernardo Gonzalez Kriegel 2015-10-22 18:34:59 UTC
Added followup, needs revision i think, so changed to Needs signoff
Comment 22 Jonathan Druart 2015-10-23 07:17:43 UTC
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>
Comment 23 Tomás Cohen Arazi 2015-10-23 12:57:18 UTC
Followup pushed to master.

Thanks for taking care, Bernardo!