Writing System in QFontDialog?
Dear All!
I am facing a problem with QFontDialog Writing System as follows.
I am opening a font Dialog
Code:
txtScrollEdit->setFont(tmpFont);
using this code. After that when I open this dialog box & choose the writing system Devanagari its shows the many Hindi Font families. In that I choose Lohit Hindi. After that I clicked over the OK button.
But when I typing the text, It displays in the English. When I reopen the dialog; It shows the any writing system. So, how a way I select the different writing pattern using with QFontDialog.
Re: Writing System in QFontDialog?
What are the values of
Code:
tmpFont.family()
tmpFont.exactMatch()
tmpFont.rawName()
Re: Writing System in QFontDialog?
Quote:
Originally Posted by
Gopala Krishna
What are the values of
Code:
tmpFont.family()
tmpFont.exactMatch()
tmpFont.rawName()
Dear Sir!
The value is shown below;
"Lohit Hindi"
true
"Multi"
Re: Writing System in QFontDialog?
Quote:
Originally Posted by
ashukla
Dear Sir!
The value is shown below;
"Lohit Hindi"
true
"Multi"
Did you try
Code:
txtScrollEdit->setCurrentFont(tmpFont);
instead of txtScrollEdit->setFont
Re: Writing System in QFontDialog?
Code:
txtScrollEdit->setCurrentFont(tmpFont);
has a same effect as setFont().
And the second I have a need to change whole text font family not from a current cursor point.
So, Sir! What should I do for that.
Re: Writing System in QFontDialog?
try QTextDocument::setDefaultFont (if you are using a QTextEdit for example)
Re: Writing System in QFontDialog?
I'd suggest taking a look at the Rich Text demo.
Re: Writing System in QFontDialog?
Quote:
Originally Posted by
jpn
Dear Sir!
I have depicted it; but unable to find the way. I have searched one way but it is not well. for setting the Hindi language first I select the Hindi SCIM setup in Linux, I type in the txtScrollEdit QTextEdit It types in Hindi; but writing system is still in Hindi by default. How a way I set the writingSystem of QFont Dialog. Please suggest me some presize hint.
Re: Writing System in QFontDialog?
I know nothing about Hindi fonts, but I suggested the demo for you to see how to properly apply font changes. You're particularly interested in TextEdit::textFamily(), TextEdit::textSize() etc. and TextEdit::mergeFormatOnWordOrSelection().
Re: Writing System in QFontDialog?
Quote:
Originally Posted by
jpn
I know nothing about Hindi fonts, but I suggested the demo for you to see how to properly apply font changes. You're particularly interested in TextEdit::textFamily(), TextEdit::textSize() etc. and TextEdit::mergeFormatOnWordOrSelection().
Here my means is not only Hindi Fonts but also writingSystem of QFontDialog. How to set the WritingSystem of QFontDialog. Because whenever I select from its list it viewed and cliked ok. But Again when I opened the dialog it any writing system appeared; which is by default.
Re: Writing System in QFontDialog?
A quick look suggests to me that there is no way to set it. Try searching Task-Tracker and send a bug report if no relevant bug is found.
Re: Writing System in QFontDialog?
Quote:
Originally Posted by
jpn
A quick look suggests to me that there is no way to set it. Try searching
Task-Tracker and send a bug report if no relevant bug is found.
Yes! You are thinking right. But I am not understanding it is provided in QFontComboBox using with ; but not in QFontDialog.
Re: Writing System in QFontDialog?
Quote:
void setWritingSystem ( QFontDatabase::WritingSystem script )
This property holds the writing system that serves as a filter for the combobox.
If script is QFontDatabase::Any (the default), all fonts are listed.
It only filter the Font Families; but does not change the required language. However still it is a problem of setting the writingSystem of QFontDialogBox.
Please view the experts the problem & suggest;
But how a way I am swiching languages according to writingSystem & font families.