Re: How to make a strikethrough font?
- From: Lex Trotman <elextr gmail com>
- To: ikorot earthlink net
- Cc: gtk-list gnome org
- Subject: Re: How to make a strikethrough font?
- Date: Fri, 11 Feb 2011 16:17:26 +1100
On 11 February 2011 15:49, <ikorot earthlink net> wrote:
> Hi,
>
>
> -----Original Message-----
>>From: Lex Trotman <elextr gmail com>
>>Sent: Feb 10, 2011 7:50 PM
>>To: ikorot earthlink net
>>Cc: gtk-list gnome org
>>Subject: Re: How to make a strikethrough font?
>>
>>Lets go back to square one, what are you using this font for?
You still didn't answer this question, at the very least you say you
are displaying some preview text, what widget are you using to display
it?
How you modify text style varies because some widgets play nice with
themes and inherit their styles from them, some allow parts of the
text to be styled differently and so have a different way of
specifying font and attribute information.
There is no way to "make a strikethrough font", strikethrough and
underline are attributes which can be applied to any font since the
renderer just has to draw a line through or under the glyph.
So even if we make your preview text show strikethrough what are you
intending to do when the user clicks ok on the panel??
Cheers
Lex
>
> OK, lets solve the problems one at a time.
>
> Problem #1.
> I'm creating a panel similar to font selection dialog box.
> In the constructor of this panel I call pango_font_description_new().
> Then I read the data about the font from configuration file and
> should change the attributes of the empty font to reflect them.
> And the update the text in the preview.
>
> Now here are 2 questions:
> 1.Am I right in the assumption that I need to use pango_attr_strikethrough_new()?
> 2.If the answer to #1 - yes, then is there an example of how to call it?
>
> Thank you.
>
>>
>>You talked about typing in the font so I assumed that a text view was
>>probably what you wanted. Pango is a very low level text rendering
>>library. Most GTK text entities have their own style controls that
>>use Pango so you don't need to.
>>
>>Cheers
>>Lex
>>
>>On 11 February 2011 14:23, <ikorot earthlink net> wrote:
>>> Hi,
>>>
>>>
>>> -----Original Message-----
>>>>From: Lex Trotman <elextr gmail com>
>>>>Sent: Feb 10, 2011 6:35 PM
>>>>To: ikorot earthlink net
>>>>Cc: gtk-list gnome org
>>>>Subject: Re: How to make a strikethrough font?
>>>>
>>>>On 11 February 2011 13:23, <ikorot earthlink net> wrote:
>>>>> Hi,
>>>>>
>>>>>
>>>>> -----Original Message-----
>>>>>>From: Lex Trotman <elextr gmail com>
>>>>>>Sent: Feb 10, 2011 5:54 PM
>>>>>>To: ikorot earthlink net
>>>>>>Cc: gtk-list gnome org
>>>>>>Subject: Re: How to make a strikethrough font?
>>>>>>
>>>>>>On 11 February 2011 12:51, <ikorot earthlink net> wrote:
>>>>>>> Antono,
>>>>>>>
>>>>>>>
>>>>>>> -----Original Message-----
>>>>>>>>From: Antono Vasiljev <self antono info>
>>>>>>>>Sent: Feb 10, 2011 5:31 PM
>>>>>>>>To: ikorot earthlink net
>>>>>>>>Cc: gtk-list gnome org
>>>>>>>>Subject: Re: How to make a strikethrough font?
>>>>>>>>
>>>>>>>>On Thu, 2011-02-10 at 16:02 -0800, ikorot earthlink net wrote:
>>>>>>>>
>>>>>>>>> I'm kind of new to GTK+.
>>>>>>>>> When looking thru the documentation of stable Pango,
>>>>>>>>> I noticed that there is no simple function call to
>>>>>>>>> make a strikethrough font.
>>>>>>>>>
>>>>>>>>> Something like: pango_font_description_set_strikethrough().
>>>>>>>>>
>>>>>>>>> Is it an oversight? How do I create such a font?
>>>>>>>>
>>>>>>>>Probably you should use pango markup:
>>>>>>>>http://library.gnome.org/devel/pango/stable/PangoMarkupFormat.html
>>>>>>>
>>>>>>> Basically what I'm looking for is have a dialog with the checkbox.
>>>>>>> When the user select the checkbox the font selected will be swtched between
>>>>>>> strikethrough and regular.
>>>>>>>
>>>>>>> AFAICT, you are referring to pango_attr_strikethrough_new().
>>>>>>> But how do I go from the pango_font_description_new() to the function above?
>>>>>>> Or I am wrong and you refer to another function?
>>>>>>>
>>>>>>
>>>>>>Thats correct, you will have to apply the attribute to the relevant
>>>>>>range of characters yourself. Just do that instead of changing the
>>>>>>font.
>>>>>
>>>>> 1. Do you have a code sample of how to go from pango_font_description_new()
>>>>> to pango_attr_strikethrough_new()?
>>>>> 2. If I want to type with the striken font (or underlined font) what do I do?
>>>>>
>>>>> Thank you.
>>>>
>>>>Are you sure you want to be laying out your own text with Pango?
>>>>Perhaps you should look at gtk_text_view & buffer instead.
>>>
>>> I need to implement a font property page similar to windows one.
>>> It will have bold, italic, underline and strikethrough functionality.
>>>
>>> Which mean that if originally font is created to display without
>>> everything, when user selects an option, font in the preview has
>>> to change.
>>>
>>> And then when user hits "Apply" and/or "OK" this font needs to be used
>>> to type the text or applied to selection.
>>>
>>> On Windows, I can change the LOGFONT member and re-create the font.
>>> But it doesn't work like this on GTK+.
>>>
>>> I also looked at GtkTextView, but didn't see anything related to the
>>> font specification.
>>>
>>> Thank you.
>>>>
>>>>Cheers
>>>>Lex
>>>>
>>>>>
>>>>>>
>>>>>>Cheers
>>>>>>Lex
>>>>>>
>>>>>>>>
>>>>>>>>--
>>>>>>>>xmpp:self antono info
>>>>>>>>gopher://antono.info/
>>>>>>>>http://antono.info/
>>>>>>>>
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> gtk-list mailing list
>>>>>>> gtk-list gnome org
>>>>>>> http://mail.gnome.org/mailman/listinfo/gtk-list
>>>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> gtk-list mailing list
>>>>> gtk-list gnome org
>>>>> http://mail.gnome.org/mailman/listinfo/gtk-list
>>>>>
>>>
>>> _______________________________________________
>>> gtk-list mailing list
>>> gtk-list gnome org
>>> http://mail.gnome.org/mailman/listinfo/gtk-list
>>>
>
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list
>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]