bugGNU Octave - Bugs: bug #66306, Fonts not changing when printing...

 
 

bug #66306: Fonts not changing when printing pdf files

Submitter:  Luiz Antonio Maccari Junior <luiz>
Submitted:  Tue 08 Oct 2024 12:54:51 PM UTC
   
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Fixed Assigned to:  None
Originator Name:  Luiz Antonio Maccari Jr. Open/Closed:  * Closed
Release:  * 9.2.0 Release: 
Operating System:  * Any Fixed Release:  9.3.0
Planned Release:  9.3.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Wed 16 Oct 2024 09:44:27 PM UTC, comment #6: 

Verified patch.  Marking bug as Fixed and closing report.

Rik <rik5>
Group administrator
Thu 10 Oct 2024 05:22:13 PM UTC, comment #5: 

Thank you for the report and for the fast fix!

Your patch fixes the issue with the original example for me, too. Since this a regression from switching to Qt6, I pushed your patch to the stable branch:
https://hg.savannah.gnu.org/hgweb/octave/rev/943e1001a427

It should be part of the next minor release of Octave.

Marking as ready for test.

Markus Mützel <mmuetzel>
Group administrator
Thu 10 Oct 2024 07:07:51 AM UTC, comment #4: 

If you build from source, you can use the patch attached to comment #3 as follows:


cd octave-9.2.0/src/
patch ./octave-svgconvert.cc < bug66306.patch
cd ..
make


I just tested that approach on my Ubuntu 20.04 computer with Qt5 and it works.

Pantxo Diribarne <pantxo>
Group Member
Wed 09 Oct 2024 11:14:55 PM UTC, comment #3: 

Is it possible to test your patch? Could give me the instructions apply it?

Luiz Antonio Maccari Junior <luiz>
Wed 09 Oct 2024 08:37:23 PM UTC, comment #2: 

The issues seems to come from QFont::setFamily not working properly in Qt6. As a workaround, I used the QFont constructor to set the family in the attached patch which fixes the issue for me.

I used the following simple code for testing

title('Free Serif - {\fontname{Liberation Sans} Liberation Sans} - {\fontsize{18} BIG Free Serif}', "fontname", "Free Serif")
print toto.pdf
system "pdffonts toto.pdf"


The patch is against default, but since this is a regression (a serious one for my use case), I would recommend applying it to stable.

(file #56493)

Pantxo Diribarne <pantxo>
Group Member
Wed 09 Oct 2024 09:25:25 AM UTC, comment #1: 

I tested on two computers which both have a self compiled Octave 9.2. I can confirm the issue with ubuntu 24.04 and Qt6 but not on Ubuntu 20.04 with Qt5. My guess is that something changed between Qt5 and Qt6 that prevents octave-svgconvert from working correctly. I'll look into this.

Pantxo Diribarne <pantxo>
Group Member
Tue 08 Oct 2024 12:54:51 PM UTC, original submission:  

Hi,

I am trying to change the fonts of a pdf figure, but the figures are not changing. I am using qt graphics toolkit and octave 9.2. My qt version is:

QMake version 3.1
Using Qt version 6.4.2 in /usr/lib/x86_64-linux-gnu

In order to test I am using the following code:




clear,clc,close all
set(0, 'DefaultLineLineWidth', 2);
set(0,'defaultAxesXGrid','on')
set(0,'defaultAxesYGrid','on')
set (0, "defaultaxesfontname", "Times")
set (0, "defaulttextfontname", "Times")
set (0, "defaultaxesfontsize", 12)

t = 0:0.001:100;
y = sin(t);

figure
plot(t,y)
title('\bf{Referência}')
ylabel('Amplitude')
xlabel('tempo (s)')

ppos = [0 0 18 8];
psiz = [18 8.5];
 set(gcf,'paperunits','centimeters','paperposition',ppos, 'papersize',psiz)
print(gcf,'teste.pdf','-r300',"-dpdf")


The right jpg figure and the wrong pdf one are annexed.

Thanks.

Luiz Antonio Maccari Junior <luiz>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #56493:  bug66306.patch added by pantxo (2KiB - text/x-patch)
file #56488:  teste.jpg added by luiz (60KiB - image/jpeg)
file #56489:  teste.pdf added by luiz (590KiB - application/pdf)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by pantxo (Posted a comment)
  • -email is unavailable- added by luiz (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 12 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-10-16 rik5 Open/ClosedOpen Closed
    2024-10-16 rik5 StatusReady For Test Fixed
        Fixed ReleaseNone 9.3.0
    2024-10-10 mmuetzel StatusPatch Submitted Ready For Test
        Operating SystemGNU/Linux Any
        Planned ReleaseNone 9.3.0
    2024-10-09 pantxo Attached File- Added bug66306.patch, #56493
        StatusConfirmed Patch Submitted
    2024-10-09 pantxo Item GroupIncorrect Result Regression
        StatusNone Confirmed
    2024-10-08 luiz Attached File- Added teste.jpg, #56488
        Attached File- Added teste.pdf, #56489

    Back to the top

    Powered by Savane 3.15-e6e5.
    Corresponding source code