Topic: TEXT - FONT

Bonjour ,
Ont trouvé des constantes dans la liste source REV 5625.  nomicons/smile
Est-il possible de changer cela avec qspinbox et de le mettre dans le fichier de configuration?
-------------------------------
Have found constants in the source listing REV 5625.
Is it possible to change this with qspinbox and put it in the config file?

----------
REV : 9625

bold

sources/qetgraphicsitem/crossrefitem.cpp
596 : font.setBold(true);


sources/richtext/richtesteditor.cpp

684 : void RichTextEditor::setFontBold(bool b)
{
    if (b)
        setFontWeight(QFont::Bold);
    else
        setFontWeight(QFont::Normal);
}

--------------------------------------------

sans serif

sources/getapp.cpp
826 : * By default the font is "sans Serif" and size 9.
835 : QString diagram_texts_family = settings.value("diagramfont", "Sans Serif").toString();
836 : qreal diagram_texts_size     = settings.value("diagramsize", 9.0).toDouble();
844 : diagram_texts_font.setWeight(QFont::Light);
859 : QString diagram_texts_item_family = settings.value("diagramitemfont", "Sans Serif").toString();
860 : qreal diagram_texts_item_size     = settings.value("diagramitemsize", 9.0).toDouble();
872 : dagiram_texts_item_font.setWeight(QFont::Light);
889 : QString dynamic_texts_item_family = settings.value("font_family", "Sans Serif").toString();
890 : qreal dynamic_texts_item_size     = settings.value("dynamicitemsize", 9.0).toDouble();
902 : dynamic_texts_item_font.setWeight(QFont::Light);
919 : QString foliolist_texts_family = settings.value("foliolistfont", "Sans Serif").toString();
920 : qreal foliolist_texts_size     = settings.value("foliolistsize", 9.0).toDouble();
928 : foliolist_texts_font.setWeight(QFont::Light);

sources/ui/configpage/generalconfigurationpage.cpp
257 : QFont font = QFontDialog::getFont(&ok, QFont("Sans Serif", 9), this);
279 : QFont font = QFontDialog::getFont(&ok, QFont("Sans Serif", 9), this);
302 : QFont font = QFontDialog::getFont(&ok, QFont("Sans Serif", 9), this);



diagramtextsfont
sources/qetapp.h
129 :         static QFont diagramTextsFont(qreal = -1.0);
        static QFont diagramTextsItemFont(qreal = -1.0);
        static QFont dynamicTextsItemFont(qreal = -1.0);
        static QFont foliolistTextsFont(qreal = -1.0);
--------------------------------------------------

setfont
sources/diagramfoliolist.cpp
273 : qp->setFont(QETApp::diagramTextsFont(13));

souces/editor/graphicpart/partdynamictextfield.cpp
168 : setFont(QETApp::diagramTextsFont(dom_elmt.attribute("font_size", QString::number(9)).toInt()));
218 : setFont(QETApp::diagramTextsFont(dom_element.attribute("size", QString::number(9)).toInt()));

sources/qetgraphicsitem/crossrefitem.cpp
202 : qp.setFont(QETApp::diagramTextsFont(5));
595 : /*QFont font = QETApp::diagramTextsFont(4);
602 : painter.setFont(QETApp::diagramTextsFont(5));*/
792 : painter.setFont(QETApp::diagramTextsFont(6));

sources/qetgraphicsitem/dynamicelementtextitem.cpp
1268 : m_slave_Xref_item->setFont(QETApp::diagramTextsFont(5));

sources/qetgraphicsitem/element.cpp
513 : deti->setText(dom_element.attribute("text", "_"));
514 :        deti->setFontSize(dom_element.attribute("size", QString::number(9)).toInt());
906 : comment_text->setFontSize(6);
925 : location_text->setFontSize(6);
969 : comment_text->setFontSize(6);
981 : location_text->setFontSize(6);

sources/qetgraphicsitem/elementtextitemgroup.cpp
731 : m_slave_Xref_item->setFont(QETApp::diagramTextsFont(5));

sources/richtext/richtesteditor.cpp
684 : void RichTextEditor::setFontBold(bool b)
{
    if (b)
        setFontWeight(QFont::Bold);
    else
        setFontWeight(QFont::Normal);
}

----------------------------------------

text_size
sources/conductorproperties.cpp
226 : text_size(9)
317 : text_size            = e.attribute("numsize", QString::number(9)).toInt();
388 : text_size            = settings.value(prefix + "textsize", "7").toInt();

----------------------------------------------------------------------------------
textwidth

souces/editor/graphicpart/partdynamictextfield.cpp
37 : setTextWidth(settings.value("dynamic_with", -1).toInt());
171 : setTextWidth(dom_elmt.attribute("text_width", QString::number(-1)).toDouble());

sources/qetgraphicsitem/dynamicelementtextitem.cpp
47 : setTextWidth(settings.value("dynamic_with", -1).toInt());
169 : setTextWidth(dom_elmt.attribute("text_width", QString::number(-1)).toDouble());

sources/qetgraphicsitem/element.cpp
909 : comment_text->setTextWidth(80);
927 : location_text->setTextWidth(80);
971 : comment_text->setTextWidth(80);
982 : location_text->setTextWidth(80);


-------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------
font_size

sources/editor/graphicspart/partdynamictextfield.cpp
168 : setFont(QETApp::diagramTextsFont(dom_elmt.attribute("font_size", QString::number(9)).toInt()));

sources/editor/graphicpart/parttext.cpp
61 : if (!ok || font_size < 1) font_size = 20;

sources/editor/texteditor.cpp
40 : font_size -> setRange(0, 144);

sources/qetgraphicsitem/dynamicelementtextitem.cpp
165 : dom_elmt.attribute("font_size", QString::number(9)).toInt());

sources/qetgraphicsitem/elementtextitemgroup.cpp
int font_size = 1;

sources/titleblockcell.cpp
15 : font_size = 9;
198 : font_size = -1;
------------------------------------------------------------------------

font-size
sources/aboutqet.cpp
76 : QLabel *title = new QLabel("<span style=\"font-weight:0;font-size:16pt;\">QElectroTech V " + QET::displayedVersion + "</span>");

fontsize
sources/qetgraphicsitem/element.cpp
514 : deti->setFontSize(dom_element.attribute("size", QString::number(9)).toInt());
906 : comment_text->setFontSize(6);
925 : location_text->setFontSize(6);
969 : comment_text->setFontSize(6);
981 : location_text->setFontSize(6);

I am an pre-retired industrial developer technician and born in 1960

Re: TEXT - FONT

Hi,

look your config is saved in QElectroTech.conf example here :

[General]
border-columns_0=false
diagramitemfont=Sans Serif
diagramitemsize=9
diagramitemstyle=0
diagramitemweight=50
dxf_path=default
dynamic_rotation=270
dynamic_with=0
dynamicitemfont=URW Palladio L
dynamicitemsize=9
dynamicitemstyle=Regular
dynamicitemweight=50
foliolistfont=Noto Serif
foliolistsize=7
folioliststyle=Italic
foliolistweight=50
font_family=Sans Serif
lang=fr
usesystemcolors=true

Post's attachments

Attachment icon QElectroTech.conf 4.66 kb, 446 downloads since 2018-12-04 

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

Re: TEXT - FONT

Hi Erick,

perhaps we use http://doc.qt.io/qt-5/qfont.html#key function in the future (Returns the font's key, a textual representation of a font).

[General]
border-columns_0=false
diagramitemfont="Sans Serif,9,-1,5,50,0,0,0,0,0,Regular"
dynamic_rotation=0
dynamic_with=-1
foliolistfont="Sans Serif,9,-1,5,50,0,0,0,0,0,Regular"
font_family="Sans Serif,9,-1,5,50,0,0,0,0,0,Regular"
lang=fr
usesystemcolors=true


But now I saw a litle problem with font type members : regular, Italic, Bold, thin, etc.. not applied ..
I keep font_size for compatibility with old project.


If you want to play game :  nomicons/smiley-green 



svn patch font_key_2.diff 
make clean
qmake qelectrotech.pro
make -j$(nproc)



https://download.qelectrotech.org/qet/forum_img/font.key2.png

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

Re: TEXT - FONT

Refresh patch

Post's attachments

Attachment icon font_key_3.diff 9.41 kb, 416 downloads since 2018-12-21 

Attachment icon font_key_4.diff 8.06 kb, 378 downloads since 2018-12-21 

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."