freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Freetype] Special one-char font?


From: Owen Taylor
Subject: Re: [Freetype] Special one-char font?
Date: Wed, 10 Jul 2002 15:03:34 -0400 (EDT)
User-agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/21.1

"Pedriana, Paul" <address@hidden> writes:

>    >>It would probably be best to have your text edit control 
>    >>keep two strings -- one being the actual password, and the 
>    >>other being the displayed string of asterisks.  I believe 
>    >>this is the implementation method chosen by current widget 
>    >>sets.
> 
> I can do that, but it would make a mess of the text edit control
> code. Try writing a multi-line multi-locale (UTF16, UTF8, and DBCS)
> text editor with text selection, variable width fonts, and horizontal 
> and vertical scrolling and then try adding the system that you 
> describe into it and you get a lot of work when instead you can 
> solve the whole problem by simply using a different font. 

[ drifting off topic ]

If you have sufficient encapsulation of the text layout and rendering
portions, it's not hard; there are maybe 30 lines in gtkentry.c (out
of 4200) to handle rendering "password" entries correctly.

Plus, as compared to using a special font, GTK+ offers the ability
to set the replacement character or to not draw anything at all.

The "secret" is just to avoid putting text drawing and measuring code
all over the control; this helps with a lot of other things as well.

Regards,
                                        Owen



reply via email to

[Prev in Thread] Current Thread [Next in Thread]