Return to Video

Linux Font Rendering Stack

  • 0:06 - 0:09
    Okay, good morning everyone.
  • 0:09 - 0:13
    I'm going to talk about the
    Linux Font Rendering stack,
  • 0:13 - 0:19
    and that is what I learned the last
    four and a half years.
  • 0:19 - 0:22
    I worked at the
    city administration of Munich.
  • 0:23 - 0:28
    For introduction to font rendering,
  • 0:30 - 0:35
    I can say writing is
    the most used interface,
  • 0:35 - 0:39
    or probably the most used interface
    between humans and the machines.
  • 0:39 - 0:46
    So all of you probably use it everyday
    on your computer.
  • 0:48 - 0:53
    Screen text is replacing text on paper
    more and more
  • 0:53 - 0:57
    and this is still an ongoing process.
  • 1:01 - 1:09
    The way from a string in a computer to
    display text is surprisingly complex,
  • 1:09 - 1:15
    And writing in itself is quite profound.
  • 1:15 - 1:25
    For example, it's influenced by history
    so probably all, or at least most,
  • 1:25 - 1:31
    writing systems are derived from some
    pictograph writing systems.
  • 1:31 - 1:34
    This is also true for Roman letters.
  • 1:36 - 1:44
    And also the Roman letters themselves,
    they changed a lot since 2000 years ago.
  • 1:44 - 1:51
    In the Roman Empire they used some
    different letters than we use now.
  • 1:51 - 1:57
    So the goal of this talk is to raise
    awareness of font rendering in computing,
  • 1:57 - 2:01
    with the focus on the Linux desktop.
  • 2:05 - 2:12
    Now to the history,
    and then I talk about typography.
  • 2:14 - 2:17
    Text display in early computing.
  • 2:17 - 2:25
    In early computing it was just
    a way to display results.
  • 2:26 - 2:30
    Before that there were
    only flashing lights
  • 2:30 - 2:34
    where you can read the results
    and...
  • 2:36 - 2:40
    [audience member] ??... BT100
    ?? raise your hand
  • 2:43 - 2:48
    [Max] And the output device receives
    a page or a character stream,
  • 2:48 - 2:52
    and then the presentation is the job
    of the output device.
  • 2:52 - 2:58
    So for example, a typewriter
    or a printer or a terminal.
  • 2:58 - 3:06
    And this is a BT100
    you can see on the right side.
  • 3:06 - 3:08
    So this is a real terminal.
  • 3:13 - 3:19
    But going on in history
    there's the home computer era.
  • 3:22 - 3:26
    In the home computer era you have
    fixed character sets
  • 3:26 - 3:32
    and most of the time due to system
    limitations, memory limitations,
  • 3:32 - 3:36
    you have graphics mode and text mode.
  • 3:38 - 3:47
    In the graphics mode you can basically
    set the pixels more or less as you want,
  • 3:47 - 3:53
    and in the text mode you can use fonts.
  • 3:56 - 4:00
    The screen configuration at that time
    is more or less defined
  • 4:00 - 4:02
    by the state of technology.
  • 4:02 - 4:08
    So every screen at that time has more or
    less the same resolution,
  • 4:08 - 4:16
    and that's something that the engineers
    of that time relied on,
  • 4:16 - 4:18
    and also software engineers relied on.
  • 4:20 - 4:25
    The text rendering was just
    using bitmap fonts.
  • 4:25 - 4:37
    That means you have a fixed size character
    and you just define it pixelwise
  • 4:39 - 4:45
    so it's some kind of hand-crafted
    characters.
  • 4:45 - 4:51
    You have a given raster and then
    you really display
  • 4:51 - 4:54
    these hard-defined characters.
  • 5:00 - 5:07
    So then I need to introduce a few
    typography terms.
  • 5:12 - 5:16
    First, there's glyph or a character.
  • 5:21 - 5:25
    That's...well you can say a symbol.
  • 5:27 - 5:32
    So I think most people can understand what
    that means.
  • 5:32 - 5:36
    Then a font, this is a set of glyphs.
  • 5:38 - 5:45
    And then we have a collection of fonts,
    that is called typeface or font family.
  • 5:45 - 5:53
    Those are closely related fonts with
    the same visual appearance,
  • 5:53 - 6:00
    And they differ only in slopes or widths
    or weights for example.
  • 6:04 - 6:12
    Usually with typesetting, with moving
    letters in the printing press,
  • 6:12 - 6:25
    you really had, for weight for example,
    different pieces/letters/hardware.
  • 6:28 - 6:31
    And then the point size,
    or typographic unit.
  • 6:33 - 6:42
    This is a measure of the size, and
    derives directly from the printing press
  • 6:42 - 6:45
    with moving letters.
  • 6:48 - 6:56
    There are different definitions, and what
    we probably all use as point size is the
  • 6:56 - 7:04
    DTP point – desktop publishing point,
  • 7:04 - 7:19
    where one point is defined as 1/72 inch,
    which is 0.3527 period millimeters.
  • 7:19 - 7:26
    It is interesting to note that this has
    nothing to do with pixels.
  • 7:29 - 7:31
    [audience] (unintelligible question)
  • 7:31 - 7:35
    [Max] Please use the microphone
    if you a question.
  • 7:36 - 7:39
    [audience] ...3257, what's the bar
    over the 7 mean?
  • 7:39 - 7:43
    [Max] It means that the 7 goes
    on and on and on forever.
  • 7:51 - 7:58
    So this is typography of the
    Latin alphabet...terminology.
  • 7:58 - 8:02
    There's something called kerning.
  • 8:02 - 8:08
    You can see an example of kerning
    on the right side.
  • 8:08 - 8:19
    So in the printing press you have letters
    and they usually have a gap.
  • 8:21 - 8:30
    To improve the readability, and to
    make all the text appear more uniform
  • 8:31 - 8:34
    the typesetter reduces the gap.
  • 8:36 - 8:40
    With moving letters they have special
    letter pairs...
  • 8:41 - 8:46
    if you go on with this
    there are ligatures,
  • 8:46 - 8:51
    which are replacement glyphs for close
    standing characters.
  • 8:52 - 8:57
    An example of this is
    a double f, fi or fl.
  • 8:58 - 9:05
    So you can see also in the slides here
    that double f is such a ligature.
  • 9:06 - 9:09
    It's one connected glyph.
  • 9:11 - 9:16
    And then there's a speciality
    if you reverse all of the ?? [static].
  • 9:18 - 9:20
    The term non-proportional font.
  • 9:20 - 9:27
    So you have a font where very character,
    every glyph, has the same width.
  • 9:27 - 9:31
    This is also called monospace font.
  • 9:34 - 9:41
    Sometimes you distinguish half-width
    and full width letters.
  • 9:41 - 9:46
    This is also something you would see
    on a typewriter for example.
  • 9:47 - 9:54
    Early bitmap fonts are usually
    monospaced fonts.
  • 9:56 - 10:02
    Okay, let's go to
    the text rendering stack.
  • 10:07 - 10:09
    Text rendering today.
  • 10:10 - 10:15
    In all computing nowadays,
    typography is introduced.
  • 10:15 - 10:24
    So won't find many devices on the market
    which don't use accurate typography.
  • 10:28 - 10:32
    Glyphs are now represented as
    size-independent outlines.
  • 10:32 - 10:38
    We can see on the right side there's
    a font editor: Font Forge.
  • 10:38 - 10:42
    This is the way that such fonts
    are created.
  • 10:42 - 10:47
    So you can see here in the picture
    the outline of the "S".
  • 10:49 - 10:56
    It's a size-independent outline and
    you can just use that for
  • 10:56 - 10:59
    every kind of display.
  • 10:59 - 11:04
    And then you do something that is called
    rasterization, or sampling, or rendering
  • 11:04 - 11:08
    for displaying it at the actual display.
  • 11:10 - 11:14
    In the past this allowed for new
    applications for computers.
  • 11:14 - 11:20
    First it allowed word processing and
    computer-based typesetting.
  • 11:21 - 11:26
    Before that typesetting was
    a very hard job.
  • 11:27 - 11:31
    It allowed internationalization.
  • 11:37 - 11:42
    It allows universal graphical interface
    which goes
  • 11:42 - 11:45
    hand-in-hand with internationalization.
  • 11:46 - 11:52
    Come to think of it, not so long ago it
    was not so common that you could
  • 11:52 - 11:58
    buy devices where you can easily switch
    the language to
  • 11:58 - 12:02
    any language you would like.
  • 12:02 - 12:05
    This is just a recent development.
  • 12:07 - 12:16
    So now I will give you an overview of
    the formats we see on Linux systems.
  • 12:16 - 12:19
    First I talk about the bitmap formats.
  • 12:19 - 12:27
    Today we have bitmap formats in the
    PC Screen Font format,
  • 12:27 - 12:29
    PSF or PSFU.
  • 12:29 - 12:36
    These are the fonts that are used for the
    Linux VT, also known as the console.
  • 12:36 - 12:46
    Usually you can store in such a font
    256 or 512 glyphs.
  • 12:46 - 12:53
    Some of them contain
    a Unicode translation table.
  • 12:54 - 13:00
    And on the other hand there are
    X Window System Bitmap Fonts.
  • 13:00 - 13:03
    There are three formats:
  • 13:03 - 13:07
    There's a Sever Normal Format (SNF).
  • 13:07 - 13:11
    Glyph Bitmap Distribution Format (BDF).
  • 13:11 - 13:14
    And Portable Compiled Format (PCF).
  • 13:14 - 13:23
    Nowadays PCF is the only letter that
    you can find on a Linux system if so,
  • 13:23 - 13:29
    and the first two are deprecated.
  • 13:29 - 13:40
    And also the X Window Bitmap Fonts
    themselves are not very common these days.
  • 13:45 - 13:47
    To the outline font formats.
  • 13:49 - 13:52
    There are Postscript Formats.
  • 13:54 - 14:05
    Postscript Formats have different versions
    as I would call them. It's called types.
  • 14:05 - 14:12
    Type 1 is the one that is still relevant,
    to a certain degree.
  • 14:12 - 14:17
    Those are the ones you can probably
  • 14:17 - 14:21
    find on a standard Debian installation
    for example.
  • 14:21 - 14:24
    It uses cubic bezier curves.
  • 14:26 - 14:36
    The file format is divided into
    different files.
  • 14:36 - 14:40
    So for every font you have
    Printer Font ASCII
  • 14:40 - 14:44
    or a Printer Font Binary file,
    and you have
  • 14:44 - 14:49
    a Print Font Metric or
    Adobe Font Metric file.
  • 14:55 - 15:01
    Then you have the Truetype file format.
  • 15:03 - 15:08
    This is more common. I guess everyone
    heard of that already.
  • 15:09 - 15:12
    It uses quadratic bezier curves.
  • 15:14 - 15:21
    It can contain optional code for
    TrueType Hinting Virtual Machine.
  • 15:21 - 15:25
    What that means I will explain latter.
  • 15:25 - 15:31
    There's a third format,
    the OpenType format,
  • 15:31 - 15:35
    which has two possible glyph formats:
    one is TrueType,
  • 15:35 - 15:41
    and the other is Compact Font Format,
    which is based on Postscript Type 2.
  • 15:41 - 15:48
    So you can say what is new in this format,
    or what's the difference?
  • 15:48 - 15:52
    Well it supports so-called Smartfonts.
  • 15:54 - 16:00
    That means you can have language-specific
    ligatures or character substitutions.
  • 16:01 - 16:10
    For example, kerning classes, which means
    you have a class of characters like
  • 16:10 - 16:14
    the A and different variations.
  • 16:14 - 16:20
    So these are A with different diacritic
    symbols,
  • 16:20 - 16:31
    and you can just use one kerning class for
    all of those characters and don't have to
  • 16:31 - 16:38
    invent the wheel for every A with
    diacritic symbols anew.
  • 16:44 - 16:50
    Now to the font rendering techniques that
    I use today.
  • 16:54 - 17:02
    This only applies to the outline fonts
    because well rendering bitmap fonts is
  • 17:02 - 17:11
    obviously quite easy. You just paint the
    pixels that are in the bitmap.
  • 17:11 - 17:17
    So rasterization is all about using
    outline fonts.
  • 17:19 - 17:25
    The one library library that is used all
    over the free and open source world
  • 17:25 - 17:26
    is FreeType.
  • 17:26 - 17:41
    It is used on Linux system, BSD desktops,
    Android, and ReactOS, and some others.
  • 17:41 - 17:47
    For example it is contained in Ghostscript
    and therefore in most of the printers.
  • 17:49 - 17:52
    It's also on iOS [exhale].
  • 17:53 - 18:00
    So the naive rasterization algorithm would
    be just lay a pixel raster over the
  • 18:00 - 18:06
    outline font, over the character you want
    to display, and if the center of the pixel
  • 18:06 - 18:10
    is inside the outline then you
    set the color to black.
  • 18:15 - 18:19
    The problem is the so called
    aliasing effect.
  • 18:19 - 18:24
    This is what you can see
    in the picture below.
  • 18:24 - 18:30
    So those are the same words,
    rendered at different resolutions.
  • 18:30 - 18:36
    The left one has 10x the resolution
    of the right one.
  • 18:39 - 18:50
    You can see that, for example,
    the 'w' is quite deformed.
  • 18:50 - 18:55
    Or the curl of the 'g';
    there's even a part missing.
  • 18:55 - 19:00
    So you have details of the font
    which are lost,
  • 19:00 - 19:02
    and you have artefacts.
  • 19:04 - 19:12
    Somehow, especially in the early computing
    days you wanted to reduce those,
  • 19:12 - 19:15
    and therefore you used a technique
    called hinting.
  • 19:15 - 19:21
    This is to avoid such artefacts and
    improve the readability
  • 19:21 - 19:23
    at lower resolutions.
  • 19:23 - 19:35
    Therefore the outline is adjusted to fit
    the pixel raster at the rasterization.
  • 19:37 - 19:42
    Some of the fonts can contain
    instructions, the so-called hints
  • 19:42 - 19:46
    where the the name comes from:
    "hinting".
  • 19:51 - 19:59
    You can see in the example here,
    in the picture above,
  • 19:59 - 20:08
    that it's quite a good result.
  • 20:08 - 20:15
    This is much more readable
    than the word above.
  • 20:15 - 20:23
    However, with the use of hinting, there
    are also characteristics of the font lost
  • 20:24 - 20:28
    which is obvious because
    if you change the outline
  • 20:28 - 20:31
    then obviously characteristics get lost.
  • 20:31 - 20:37
    And especially important for
    word processing,
  • 20:37 - 20:40
    what you see is what you get
    word processing,
  • 20:40 - 20:44
    is that the tracking
    of the font is changed.
  • 20:46 - 20:50
    So tracking means the width
    of single characters.
  • 20:50 - 20:57
    The picture below, this is a picture I
    took from LibreOffice.
  • 20:57 - 21:05
    If you have a close look, you can see
    that the gap between those 'i' characters
  • 21:05 - 21:07
    is not always the same.
  • 21:08 - 21:17
    But if do word processing, you actually
    want to have a result which looks the same
  • 21:17 - 21:19
    as on the printout.
  • 21:20 - 21:27
    So I would recommend not
    to hint fonts in
  • 21:27 - 21:30
    a what you see is what you get
    word processor.
  • 21:34 - 21:41
    If you have a look beyond the backyard,
    on macOS there exists no hinting,
  • 21:41 - 21:46
    and in the Windows world, hint can't
    be turned off,
  • 21:46 - 21:52
    so this is hardwired in the
    font rendering of the Windows system.
  • 21:56 - 22:03
    Well another approach to improve
    readability is anti-aliasing
  • 22:03 - 22:08
    which applies multisampling.
  • 22:08 - 22:16
    So for every pixel you take samples at
    different spots
  • 22:16 - 22:22
    and then you compute from
    that a gray value,
  • 22:22 - 22:29
    which is a measure of how much of the
    area of the pixel is covered by the glyph.
  • 22:33 - 22:40
    On the picture you can see again
    the simple raster word,
  • 22:40 - 22:46
    and then in the middle you see the word
    with anti-aliasing,
  • 22:46 - 22:56
    and below you can see a combination of
    hinting and antialiasing.
  • 22:59 - 23:03
    Suddenly the text becomes very readable
    also on low resolutions.
  • 23:05 - 23:12
    This is what was usually used in
    computing in the 90s.
  • 23:18 - 23:24
    So there is another approach to improve
    and therefore I have to
  • 23:24 - 23:27
    talk a bit about LCD displays.
  • 23:27 - 23:37
    So in the picture on the left, above you
    can see tube monitor pixels and
  • 23:37 - 23:41
    on the bottom you can see
    LCD monitor pixels.
  • 23:41 - 23:50
    All of the pixels consist of so-called
    subpixels with different colors.
  • 23:52 - 23:56
    The mixture of the three different colors
  • 23:56 - 24:02
    gives them a wide range
    of different colors.
  • 24:05 - 24:13
    With the tube monitors this is not used,
    but with LCD display
  • 24:13 - 24:19
    depending on the
    configuration of the subpixels
  • 24:19 - 24:23
    it can be used to improve improve the
    resolution in one direction.
  • 24:23 - 24:29
    Therefore you have to know how the
    configuration of the display is.
  • 24:29 - 24:37
    So usually, one pixel, which you can see
    in the picture below right?
  • 24:37 - 24:40
    These are the usual computer monitors.
  • 24:40 - 24:52
    One pixel consists of a red, green and a
    blue subpixel in this order.
  • 24:52 - 24:58
    But you have to keep in mind, especially
    with tablets, or smartphones,
  • 24:58 - 25:05
    you can rotate the screen, so you have to
    keep that in mind.
  • 25:06 - 25:11
    Also there are other subpixel
    configurations.
  • 25:11 - 25:18
    For example, depending on the technology
    there can be additional red or green
  • 25:18 - 25:20
    or even white subpixels.
  • 25:24 - 25:30
    So there are also multiple possibilities
    of the configuration.
  • 25:34 - 25:40
    We can use this configuration as I said
    to improve the resolution
  • 25:40 - 25:45
    and in the usual case
    this is horizontally.
  • 25:45 - 25:50
    You can see on the picture
    on the left side,
  • 25:53 - 25:59
    first there's the naive,
    simple rendered character,
  • 25:59 - 26:04
    then the character
    just using anti-aliasing,
  • 26:04 - 26:08
    and then there's the
    subpixel rendered character.
  • 26:10 - 26:16
    This one is the most readable
    or most sharp character.
  • 26:16 - 26:25
    Not sharp!... but it's most correctly
    rendered according to the outline font.
  • 26:26 - 26:31
    Depending on the technique of the display,
  • 26:31 - 26:41
    you can see a color haze
    around the characters.
  • 26:44 - 26:49
    So this happens when the software
    and the display technology
  • 26:49 - 26:52
    don't match each other.
  • 26:54 - 26:59
    So this is what you can see
    on the picture on the right.
  • 27:01 - 27:08
    Okay, let's talk about the font rendering
    software parts in the Linux desktop.
  • 27:11 - 27:15
    There's the so-called server-side
    text rendering.
  • 27:17 - 27:22
    So in the X server there's the
    Core Font subsystem.
  • 27:25 - 27:32
    With that, X11 clients can request the
    server to display a text
  • 27:32 - 27:36
    by sending a string via libXfont
  • 27:36 - 27:45
    and using the so-called
    X Logical Font Description (XLFD).
  • 27:45 - 27:53
    Here's an example for Adobe Career font,
  • 27:53 - 28:03
    then the X server has to
    render the text using the font.
  • 28:06 - 28:11
    If you imagine a terminal server setup
    with thin clients,
  • 28:11 - 28:18
    then the thin client runs the X server
    and the terminal server runs the X client
  • 28:18 - 28:28
    and every thin client then has to
    handle the font rendering.
  • 28:28 - 28:35
    So I don't know if
    this is the only reason,
  • 28:35 - 28:41
    but nowadays server-side font
    rendering is not so common.
  • 28:41 - 28:48
    Probably not used anymore.
  • 28:53 - 28:56
    Now I have to talk first
    about font management.
  • 28:56 - 29:02
    In Linux systems there is
    a software called fontconfig,
  • 29:02 - 29:05
    which manages installed fonts
    on the system
  • 29:05 - 29:16
    and it configures for example how to
    substitute fonts.
  • 29:17 - 29:24
    For example if in a document there's a
    font to render a text
  • 29:24 - 29:27
    and the font is not
    available on the system
  • 29:27 - 29:34
    then in the font config system there can
    be rules to replace the font
  • 29:34 - 29:37
    with a similar font.
  • 29:37 - 29:41
    This is heavily used in Linux systems.
  • 29:41 - 29:48
    There are also rules for what font to
    use if the current selected font
  • 29:48 - 29:51
    doesn't contain a character
    you want to display.
  • 29:53 - 29:59
    You can see on the picture on the right
    that this is also used...
  • 29:59 - 30:02
    although I have to admit,
  • 30:02 - 30:08
    I had to take this picture on a Debian 5.0
    system in LibreOffice
  • 30:08 - 30:12
    because nowadays
    it works a bit different,
  • 30:12 - 30:18
    but this is a good example where
    you can see that those characters
  • 30:18 - 30:21
    come from different fonts actually.
  • 30:23 - 30:28
    There's also a command line tool
    which is quite nice.
  • 30:28 - 30:30
    fc-match command line tool.
  • 30:30 - 30:37
    So for example if you want to see what is
    the replacement font for, let's say, Arial
  • 30:37 - 30:41
    then you get the output:
    okay, it's Nimbus Sans.
  • 30:45 - 30:48
    And you can also set rendering options,
  • 30:48 - 30:56
    which means you can set anti-aliasing
    or you can turn off hinting.
  • 31:00 - 31:07
    Usually these configurations are stored in
    /etc/fonts
  • 31:07 - 31:12
    and there is also a per-user configuration
    in .config/fontconfig
  • 31:12 - 31:20
    and it's in XML file format snippets.
  • 31:22 - 31:25
    In the picture you can see an example.
  • 31:25 - 31:33
    This is the replacement rule for
    Carlito and Calibri.
  • 31:36 - 31:42
    Carlito is a replacement font for the
    nowadays often used
  • 31:42 - 31:44
    Calibri font from Microsoft.
  • 31:46 - 31:54
    So this configuration says the one way,
    Carlito is the same as Calibri,
  • 31:54 - 31:56
    and the other way around.
  • 31:56 - 31:58
    This is just an example,
  • 31:58 - 32:04
    you can have a look at /etc/fonts
    and a lot of such snippets.
  • 32:07 - 32:13
    It defines how fonts are
    displayed on the system.
  • 32:16 - 32:24
    Another thing, and this is the reason
    why I had to take the screenshot
  • 32:24 - 32:30
    on an older system, there's a piece of
    software called HarfBuzz.
  • 32:30 - 32:35
    HarfBuzz is Persian for OpenType,
  • 32:35 - 32:41
    so this software relies on the OpenType
    font format.
  • 32:41 - 32:46
    You can see on the right side
    the HarfBuzz logo
  • 32:46 - 32:50
    that actually says
    HarfBuzz in Persian.
  • 32:54 - 32:56
    Before I talked about ligatures,
  • 32:56 - 33:03
    In some languages ligatures are required
    to render fonts correctly
  • 33:03 - 33:09
    and this is an example on the left of
    Devanagari, which is an Indic script.
  • 33:12 - 33:18
    So if you have the first two characters
    combined then this is the rule
  • 33:18 - 33:24
    of how to replace those characters
    with a third glyph.
  • 33:29 - 33:34
    There were early implementations
    by Qt and Pango
  • 33:34 - 33:39
    and those were integrated in HarfBuzz.
  • 33:41 - 33:45
    Well those parts are now known as
    Harfbuzz Old,
  • 33:45 - 33:50
    and the current HarfBuzz is a rewrite.
  • 33:52 - 33:57
    Nowadays it's also used for
    the so-called simple script,
  • 33:59 - 34:04
    meaning especially Latin script,
  • 34:04 - 34:12
    and is integrated into Qt, GTK,
    LibreOffice, Firefox, Android, and XETEX.
  • 34:12 - 34:15
    This is what I use for the slides here,
  • 34:15 - 34:21
    so all the slides here are
    also rendered using HarfBuzz.
  • 34:21 - 34:25
    And of course the whole
    font rendering stack.
  • 34:26 - 34:35
    HarfBuzz also has fancy features like
    variable widths or weight
  • 34:35 - 34:46
    with only one font or you can define
    in the font characters with
  • 34:46 - 34:56
    variable widths and without stepping you
    can change it using HarfBuzz.
  • 35:00 - 35:05
    Those techniques are used in
    client-side rendering.
  • 35:07 - 35:15
    One library often was
    until recently often used, Xft.
  • 35:18 - 35:22
    Well this is the applications meaning the
    X clients render the text
  • 35:24 - 35:27
    based on FreeType and fontconfig.
  • 35:28 - 35:31
    Then the X server
    only displays the results.
  • 35:32 - 35:36
    Well, there is some caching involved,
  • 35:36 - 35:42
    and it requires
    an extension to the protocol.
  • 35:51 - 35:56
    In the widget libraries this was also
    used a long time,
  • 35:56 - 36:02
    but now Qt, for example, has its own
    code for font rendering
  • 36:02 - 36:05
    based on HarfBuzz, FreeType,
    and fontconfig.
  • 36:05 - 36:09
    There's the combination of
    Pango and Cairo,
  • 36:09 - 36:13
    which is used in the GTK environment.
  • 36:13 - 36:23
    Pango derives from Greek and Japanese:
    pan means all and go means languages.
  • 36:23 - 36:30
    So this is the background to write
    in all languages.
  • 36:30 - 36:34
    This also uses HarfBuzz, FreeType,
    and fontconfig.
  • 36:34 - 36:40
    And if you look at Wayland clients,
    they only do client-side rendering.
  • 36:43 - 36:48
    To sum it up, we have a variety of
    techniques for text display.
  • 36:50 - 36:54
    Some have historical than
    practical value nowadays.
  • 36:54 - 36:59
    The modern font rendering stack
    is quite complex.
  • 37:04 - 37:09
    But writing is one of the
    main interface to computers,
  • 37:09 - 37:12
    so developers should be aware
    of the complexity.
  • 37:14 - 37:17
    Keep that in mind.
  • 37:18 - 37:19
    Thank you.
  • 37:20 - 37:24
    [applause]
  • 37:34 - 37:35
    Are there any questions?
  • 37:41 - 37:45
    [audience] More a request than a question,
    I find the topic very interesting
  • 37:45 - 37:51
    and I'd like to check it again. I know
    your video was not recorded
  • 37:51 - 37:54
    or I think it was not recorded...
  • 37:54 - 37:57
    [Max] Well it was I think.
  • 37:58 - 38:05
    [audience] Okay so nevermind, but still
    if you are able to share your presentation
  • 38:05 - 38:05
    [Max] Yes
  • 38:05 - 38:08
    [audience] I would be very
    happy to look at it. Thank you.
  • 38:17 - 38:26
    [audience] [tests mic] What's
    the problem due to the
  • 38:26 - 38:33
    complexity from the software stack
    in your open ??.
  • 38:33 - 38:36
    [Max] The problem of what?
  • 38:36 - 38:48
    [audience] What's the problem it came from
    this complex software stack
  • 38:48 - 38:50
    in your open ??.
  • 38:50 - 38:59
    There's no problem with that,
    or there's some problem
  • 38:59 - 39:11
    with these lot of layers, very lot of
    components to render the font.
  • 39:11 - 39:17
    [Max] Okay, I try to rephrase the question
    [audience] Please.
  • 39:17 - 39:23
    [Max] What is the reason there is so many
    layers in the font rendering stack today.
  • 39:23 - 39:24
    [Max] Is that correct?
  • 39:24 - 39:38
    [audience] And it caused some problem. Do
    you know any problem
  • 39:38 - 39:42
    with current font rendering system.
  • 39:42 - 39:44
    [Max] Colored font rendering system?
  • 39:44 - 39:46
    [audience] Current, now.
  • 39:48 - 39:49
    [Max] Ah current font-
  • 39:49 - 39:52
    [audience 2] The question is
    whether the complexity
  • 39:52 - 39:56
    means that there are
    difficulties for developers.
  • 39:56 - 39:57
    Is it too complex?
  • 39:57 - 39:58
    Does that cause problems?
  • 39:58 - 40:03
    [Max] Well the complexity is hidden behind
    the font rendering stack.
  • 40:03 - 40:11
    So it's a huge collection of software,
  • 40:11 - 40:18
    usually there's HarfBuzz, fontconfig,
    and FreeType heavily used nowadays.
  • 40:18 - 40:22
    But it's all encapsulated
    in these libraries
  • 40:22 - 40:29
    and it's used all over
    the free software world
  • 40:30 - 40:39
    and it makes it easy to write applications
    which are easily translatable.
  • 40:40 - 40:48
    [audience] Yes but for example,
    the fontconfig is not so flexible.
  • 40:48 - 40:55
    For example, when we're using
    mainly Japanese
  • 40:55 - 41:02
    and other display of the language,
  • 41:02 - 41:13
    then the font of config chooses the
    non-Japanese font like the Chinese one.
  • 41:13 - 41:28
    I know some distributions like Ubuntu make
    language specific fontconfig file
  • 41:28 - 41:36
    for each language to deal with but
    Debian doesn't have such a mechanism.
  • 41:39 - 41:48
    So in my opinion the fontconfig
    is a bit terrible so
  • 41:48 - 41:55
    is there any ?? meant or any hack for it?
  • 41:55 - 42:05
    [Max] Okay, the fontconfig system comes
    from the time where XML was popular.
  • 42:05 - 42:07
    [audience] Mhmm
    [Max] As you can see.
  • 42:09 - 42:15
    Well the problem here is
    not so much the software stack
  • 42:15 - 42:19
    more than the Unicode system.
  • 42:19 - 42:25
    So in the Unicode system there are
    same code points for
  • 42:25 - 42:31
    Japanese and Chinese characters somewhere
    although they have different appearances.
  • 42:31 - 42:39
    In the fontconfig system there are
    replacement rules for characters
  • 42:39 - 42:48
    and it is just a list and usually Chinese
    fonts are listed first.
  • 42:48 - 42:55
    So that is the reason why in the Japanese
    language you get Chinese characters
  • 42:55 - 42:57
    instead of Japanese characters.
  • 42:57 - 43:02
    So I also think there's room to improve
    the software stack, yes.
  • 43:02 - 43:03
    [audience] Thank you.
  • 43:16 - 43:20
    [Max] Okay, done. Thank you.
  • 43:20 - 43:25
    [applause]
Title:
Linux Font Rendering Stack
Description:

Displaying text is the most common interface to convey information from computer systems to humans. On a Linux system there is a variety of techniques for rendering text some of which are used more or less on modern systems. Many of those text rendering techniques originate from different time periods of computing history and rendering text in graphical environments is more complex than often thought off.

We find two approaches in Linux systems for displaying text: - using bitmap fonts designed for fixed resolution displays - rendering text based on scalable glyph shapes using a stack of software components for rasterisation, text shaping and text layout.

This talk will give an overview on the different techniques, software and standards for font rendering on Linux systems in the context of their historical origins.

Speaker: Max Harmathy
At: DebConf18

more » « less
Video Language:
English
Team:
Debconf
Project:
2018_debconf18
Duration:
43:31

English subtitles

Revisions Compare revisions