Xlib and rotated text?
Chris
devnullaccount at yahoo.se
Fri Mar 18 09:26:30 PDT 2011
Hi Alan & Peter,
thanks for both your suggestions. I will try to implement using one of them, and if I fail with both, I'll move to some higher-level lib. I agree with not inventing the wheel too often, but in this case, the rotated text is the *only* feature I will be using that is not easily available in XLib. Therefore it feels overkill to add dependencies for this thing.
BR,
Chris
--- On Thu, 3/17/11, Alan Coopersmith <alan.coopersmith at oracle.com> wrote:
> From: Alan Coopersmith <alan.coopersmith at oracle.com>
> Subject: Re: Xlib and rotated text?
> To: "Chris" <devnullaccount at yahoo.se>
> Cc: xorg at lists.freedesktop.org
> Date: Thursday, March 17, 2011, 8:42 PM
> On 03/17/11 10:52 AM, Chris wrote:
> > I want to write some strings that are rotated 90
> degrees. If the solution handles ASCII, then that's
> sufficient, but if it handles latin-1 then even better, but
> I don't need any unicode or such.
> > So, can I do it in Xlib without writing the complete
> matric algebra by myself (if so, where can I find an
> example/manual/tutorial), should I use xvertext, freetype or
> something completely different that I haven't found yet?
>
> No. The font handling used by Xlib can
> rotate characters, not strings,
> so if you set it to a 45 degree rotation you will have a
> line of text
> in a horizontal line across your screen in which each
> character has been
> rotated 45 degrees. For example, run:
> xfontsel -fn '-adobe-new century
> schoolbook-medium-r-normal--0-[12 12 0
> 12]-100-100-p-0-iso8859-1'
>
> If you can find a copy of the O'Reilly manual
> "Programmer's Supplement for Release 6 of the X Window
> System", it has
> a chapter on "The Matrix XLFD enhancement" that gives
> details.
> Online sources of info include:
> http://www.x.org/releases/current/doc/xorg-docs/specs/XLFD/xlfd.html#matrix_transformations
> http://www.math.upenn.edu/~kazdan/210/LectureNotes/x11r6_fonts_94.pdf
>
> I'd really suggest using higher level libraries like pango
> & freetype
> rather than trying to reinvent them yourself though.
>
> --
> -Alan Coopersmith-
> alan.coopersmith at oracle.com
> Oracle Solaris Platform
> Engineering: X Window System
>
> _______________________________________________
> xorg at lists.freedesktop.org:
> X.Org support
> Archives: http://lists.freedesktop.org/archives/xorg
> Info: http://lists.freedesktop.org/mailman/listinfo/xorg
> Your subscription address: devnullaccount at yahoo.se
>
More information about the xorg
mailing list