X font handling, programming - Xwindows

This is a discussion on X font handling, programming - Xwindows ; Please if this is not the correct newsgroup indicate wich is thanks? Using the Xlib library developing a X application: Having a Font ID, how I obtain the font file path of that font or the font data that contains ...

+ Reply to Thread
Results 1 to 9 of 9

Thread: X font handling, programming

  1. X font handling, programming

    Please if this is not the correct newsgroup indicate wich is thanks?

    Using the Xlib library developing a X application:
    Having a Font ID, how I obtain the font file path of that font or the font
    data that contains the font file.

    Thanks



  2. Re: X font handling, programming

    "Toni Martir" wrote in message news:...
    > Please if this is not the correct newsgroup indicate wich is thanks?


    This is the correct forum.

    > Using the Xlib library developing a X application:
    > Having a Font ID, how I obtain the font file path of that font or the font
    > data that contains the font file.


    Sorry, Xlib has no such function.

    X client can request the font from X server (which can run
    on other machine) only. X server tries to find it using its
    configuration settings. If the X server supports it and if it
    is configured that way, the X server can use font server which
    can run on other machine too.

    And note that in theory the font doesn't need to be stored on disk
    at all -- the X server or font server can store it in database or
    wherever it wishes.

    X clients shoud not matter where the fonts are from. It's X server's
    problem to provide them for clients.

    Mity

  3. Re: X font handling, programming

    > And note that in theory the font doesn't need to be stored on disk
    > at all -- the X server or font server can store it in database or
    > wherever it wishes.
    >
    > X clients shoud not matter where the fonts are from. It's X server's
    > problem to provide them for clients.


    I'm new to X programming, after some investigation I see X server does not
    need a Font Server at all, it's optional, so in some way the X server reads
    font information from font paths and optional font server.
    What I really need is:
    - Get the sizes of the font characters, Xlib allow this.
    - Get the full font data (not needed the font file path, but the data it
    contains), the font sizes are also inside this files.
    - I need the font data to embed it in a PDF file.

    Thanks for your detailed answer.



  4. Re: X font handling, programming

    Hi Toni!

    On 22 May 04 at 11:08, "Toni" (Toni Martir) wrote:

    Toni> font server. What I really need is: - Get the sizes of the font
    Toni> characters, Xlib allow this. - Get the full font data (not needed
    Toni> the font file path, but the data it contains), the font sizes are
    Toni> also inside this files.

    XLoadQueryFont() returns the font glyph data.

    Toni> - I need the font data to embed it in a PDF
    Toni> file.

    If you need the glyphs themeselves, you can render these on a Bitmap
    to get the raster glyphs. You can also look at libfreetype for
    rendering of local ( e.g. "with a font path" ) TrueType fonts.


    --
    Sincerely,
    Dmitry

    --- www.karasik.eu.org ---


  5. Re: X font handling, programming

    > XLoadQueryFont() returns the font glyph data.

    It does not return all the font data (all the data contained in the font
    file).
    Note I need the equivalent to GetFontData in MS Windows API.

    This information will be used to embed the font inside a pdf file so the
    font data (font program) is needed.

    About libfreetype, I think it works with font files, and I have no access to
    that files, I'm asking how to access that files or get the data inside them
    from a X application.

    I'm developing TrueType font embedding in Report Manager
    http://reportman.sourceforge.net

    Is there a more specialized newsgroup/mail list?

    "Dmitry Karasik" escribio en el mensaje
    news:84zn80qser.fsf@plab.ku.dk...
    > Hi Toni!
    >
    > On 22 May 04 at 11:08, "Toni" (Toni Martir) wrote:
    >
    > Toni> font server. What I really need is: - Get the sizes of the font
    > Toni> characters, Xlib allow this. - Get the full font data (not needed
    > Toni> the font file path, but the data it contains), the font sizes are
    > Toni> also inside this files.
    >
    > XLoadQueryFont() returns the font glyph data.
    >
    > Toni> - I need the font data to embed it in a PDF
    > Toni> file.
    >
    > If you need the glyphs themeselves, you can render these on a Bitmap
    > to get the raster glyphs. You can also look at libfreetype for
    > rendering of local ( e.g. "with a font path" ) TrueType fonts.
    >
    >
    > --
    > Sincerely,
    > Dmitry
    >
    > --- www.karasik.eu.org ---
    >




  6. Re: X font handling, programming

    Hi Toni!

    On 22 May 04 at 20:05, "Toni" (Toni Martir) wrote:

    >> XLoadQueryFont() returns the font glyph data.


    Toni> It does not return all the font data (all the data contained in the
    Toni> font file). Note I need the equivalent to GetFontData in MS Windows
    Toni> API.

    In the core X protocol abstraction, XLoadQueryFont()'s data are the only
    font data you can get.

    Toni> About libfreetype, I think it works with font files, and I have no
    Toni> access to that files, I'm asking how to access that files or get the
    Toni> data inside them from a X application.

    I assume you realize that a X application can run remotely, so there must
    be a mechanism for transferring these data between application and a X
    server, either in core X (XLoadQueryFont), or in some X extension, but
    I'm not aware if there are X extensions that provide data you want.

    --
    Sincerely,
    Dmitry

    --- www.karasik.eu.org ---


  7. Re: X font handling, programming

    Toni Martir wrote:
    >> XLoadQueryFont() returns the font glyph data.

    >
    >It does not return all the font data (all the data contained in the font
    >file).
    >Note I need the equivalent to GetFontData in MS Windows API.
    >
    >This information will be used to embed the font inside a pdf file so the
    >font data (font program) is needed.
    >
    >About libfreetype, I think it works with font files, and I have no access to
    >that files, I'm asking how to access that files or get the data inside them
    >from a X application.
    >
    >I'm developing TrueType font embedding in Report Manager
    >http://reportman.sourceforge.net
    >
    >Is there a more specialized newsgroup/mail list?

    [snip]

    The situation with fonts is considerably more complicated in X than it
    is in Windos. X supports many different types of fonts, including
    bitmap, several types of scalable fonts, and the builtin fonts on
    devices such as X terminals and printers. It also has the remote font
    server aspect.

    Loading a font into the X server basically causes a set of bitmaps to
    be realized which are appropriate for rendering text in a certain
    style; this operation is intrinsically dependent on the environment,
    eg on the fonts available, on the screen size, etc. This is a late
    binding of the XLFD (X logical font definition) with an actual set of
    bitmapped glyphs. This is in stark contrast to a much earlier binding
    of a truetype font name to an application resource.

    What you are trying to do (by looking at the font file) is not a
    suitable solution in X. It reminds me of what happens when people try
    to use screendumps in documentation -- they often look horrible. This
    is because the rendering of the screen image has lost important
    information that cannot be reconstructed in such a way as to re-render
    on a different device. You are falling into essentially the same
    trap.

    The whole idea of .pdf files is that they are an abstraction that can
    be converted to a rasterized representation on a wide range of
    devices. I am at a loss as to why you want to subvert or out-guess
    this functionality.


  8. Re: X font handling, programming

    > Loading a font into the X server basically causes a set of bitmaps to
    > be realized which are appropriate for rendering text in a certain
    > style; this operation is intrinsically dependent on the environment,
    > eg on the fonts available, on the screen size, etc. This is a late
    > binding of the XLFD (X logical font definition) with an actual set of
    > bitmapped glyphs. This is in stark contrast to a much earlier binding
    > of a truetype font name to an application resource.


    I only want to implement this for TrueType, probably it's also easy for
    Type1 fonts.

    > The whole idea of .pdf files is that they are an abstraction that can
    > be converted to a rasterized representation on a wide range of
    > devices. I am at a loss as to why you want to subvert or out-guess
    > this functionality.


    Because this, I need the font file data, not just a few bitmaps renderized
    by the X server, the font file data is the data that is embedded inside pdf
    files containing embeded true type fonts (is also the data GetFontData Win32
    function is returning).

    I think you don't understand my question, let's explain:
    - I program a X client aplication that uses Xlib to renderize and show to
    the user a page.
    - This program now needs to write the page to a pdf file, all is ok but I
    need font data to be embedded in te pdf file for TrueType fonts, so I need
    this data, this is the font file data (not a set of already drawn glyphs on
    the X-Server screen)

    So as far as I know if I understand the XWindow system:
    - The information about fonts is in the X-Server, the X client (my
    application) can ask some info about the fonts (some metrics), and also can
    order the X-Server to draw fonts in a window in the X-Server.
    - This font information is usually get by X-Server using a FontPath
    configuration and some font handling libraries (Freetype for example), but
    not only this, take care the FontPath can contain references to Font
    Servers, the font servers can be at any other network machine.
    - The above sentence is usually true for X-Servers hosted at Linux/Unix
    operating systems, but not for X-Server hosted in Microsoft Windows, where
    the font data is obtained using Win32 API functions.

    So:
    - I know the font information is on X-Server.
    - I don't know how to ask for it from the X client application, I can only
    ask for metrics and draw glyphs on the X-Server but not get full font data
    to embed this data in the pdf file.

    I hope you understand now what I'm asking for, maybe impossible..., I'm new
    in X Window programming, please correct me if I'm wrong.

    Thanks



  9. Re: X font handling, programming

    Toni Martir wrote:
    [snip]
    > It does not return all the font data (all the data contained in the font
    > file).
    > Note I need the equivalent to GetFontData in MS Windows API.
    >
    > This information will be used to embed the font inside a pdf file so the
    > font data (font program) is needed.


    So you want to implement your own print support, right ? X11 has it's
    own print API (incl. PS/PDF output) - see http://xprint.mozdev.org/ ...

    ----

    Bye,
    Roland

    --
    __ . . __
    (o.\ \/ /.o) roland.mainz@nrubsig.org
    \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer
    /O /==\ O\ TEL +49 641 7950090
    (;O/ \/ \O

+ Reply to Thread