PDA

View Full Version : Writing System in QFontDialog?



ashukla
20th January 2008, 09:14
Dear All!
I am facing a problem with QFontDialog Writing System as follows.

I am opening a font Dialog

QFont tmpFont(QFontDialog::getFont(0,txtScrollEdit->font()));
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.

Gopala Krishna
20th January 2008, 09:58
What are the values of

tmpFont.family()
tmpFont.exactMatch()
tmpFont.rawName()

ashukla
20th January 2008, 10:17
What are the values of

tmpFont.family()
tmpFont.exactMatch()
tmpFont.rawName()
Dear Sir!
The value is shown below;
"Lohit Hindi"
true
"Multi"

Gopala Krishna
20th January 2008, 10:34
Dear Sir!
The value is shown below;
"Lohit Hindi"
true
"Multi"

Did you try

txtScrollEdit->setCurrentFont(tmpFont);
instead of txtScrollEdit->setFont

ashukla
20th January 2008, 10:55
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.

elcuco
20th January 2008, 21:34
try QTextDocument::setDefaultFont (if you are using a QTextEdit for example)

jpn
21st January 2008, 06:36
I'd suggest taking a look at the Rich Text demo (http://doc.trolltech.com/latest/demos-textedit.html).

ashukla
23rd January 2008, 09:03
I'd suggest taking a look at the Rich Text demo (http://doc.trolltech.com/latest/demos-textedit.html).
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.

jpn
23rd January 2008, 09:16
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().

ashukla
23rd January 2008, 09:27
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.

jpn
23rd January 2008, 09:34
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.

ashukla
23rd January 2008, 09:52
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
void setWritingSystem ( QFontDatabase::WritingSystem script ); but not in QFontDialog.

ashukla
23rd January 2008, 10:17
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.