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