[Poppler-bugs] [Bug 107151] Add font color in Poppler
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Wed Jul 25 21:38:53 UTC 2018
https://bugs.freedesktop.org/show_bug.cgi?id=107151
--- Comment #12 from Tobias Deiminger <haxtibal at posteo.de> ---
(In reply to Dileep Sankhla from comment #11)
> I have created a draft patch here:
> https://cgit.kde.org/scratch/dileepsankhla/okular-gsoc2018-typewriter.git/
> tree/font_color_poppler_core/font_color.patch
I changed your patch to make it work, see
https://cgit.kde.org/scratch/dileepsankhla/okular-gsoc2018-typewriter.git/plain/font_color_poppler_core/0001-Create-and-parse-DA-string-in-AnnotFreeText.patch
> 1) Whenever I create a typewriter annotation in the modified okular,
> I get "SIGABRT Error"
The crash was because pointers inside apStr were not yet initalized when
createNativeAnnot was called.
> 2) I have hardcoded textElement.setAttribute( QStringLiteral("font")
Ah, noted this too late. With my patch textFont() reads from core. So you can
revert your line to
textElement.setAttribute( QStringLiteral("font"), textFont().toString() )
However, because font family is not yet saved in the PDF (only "Invalid_font"
is saved) and just a default QFont is constructed, QFont::family() is probably
lost on document reload. This is independent from this patch and probably
happens also with released poppler versions. Did not check it.
> 3) What do you say about the patch? Is it neat and promising
There were some problems, like globals should be avoided almost always in C++,
and you should use automatic memory management where possible (here we can do
it by putting variables on stack), and the getters for text and color had been
removed but we still need them. There's still something to do, grep for "TODO"
in my patch.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/poppler-bugs/attachments/20180725/b255466a/attachment.html>
More information about the Poppler-bugs
mailing list