Skip to content

Font kerning #73

@nagyrobi

Description

@nagyrobi

kerning - the process of adjusting the spacing between characters in a proportional font, usually to achieve a visually pleasing result.
kerning_explained
LVGL and lv_font_conv supports it, and built-in fonts seem to use it.

With ESPHome's font renderer, lack of kerning is noticeable:
no_kerning
See the space between í and c is bigger than the space between i and o simply because the accent of í pushes it to the right.
highlight

To reproduce:

  - file: 'fonts/RobotoCondensed-Regular.ttf'
    id: roboto_condensed_20
    size: 20
    bpp: 4
    glyphs: [
      0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,á,Á,é,É,í,Í,ó,Ó,ö,Ö,ő,Ő,ú,Ú,ü,Ü,ű,Ű,\,/,
      (,),+,-,_,.,°,•,µ,
      "\u0020", #space
      "\u0021", #!
      "\u0022", #"
      "\u0025", #%
      "\u0027", #'
      "\u002C", #,
      "\u003A", #:
      "\u003D", #=
      "\u003F", #?
      ]

and put the word pozíció into a label using the font above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions