![]() Texty = y + (h + (dc.fonts->ascent + dc.fonts->descent))/2 - dc.fonts->descent (edit: I did not see you already added an option, but I know that's only a temporary workaround) Indeed I don't think there is a simple and elegant solution for this and I don't even recommend using my solution in your project. If you want to change the character alignment for dwm, the texty variable is called ty there and belongs to the file drw.c, in the function drw_text() (just grep for a call to the function XftDrawStringUtf8(), which is on the line below Thank you for reply. The people there know more about libfontconfig, libXft (and fonts in general and their issues) than me. I think you should send a mail to the suckless dev mailing list informing them about the problem on alignment of CJK characters and how they could solve it. Texty = y + (h - 4*(currfont->ascent + currfont->descent)/3)/2 + currfont->ascent + the problem with this formula is that it depends on the geometry of the fonts you are using, in my font configuration, using your formula, the text does not render centralized on the menu item.įor now, I may add an option -f that makes the font alignment depends solely on the first font, as in formula, but this solution may be broken in the cases I specified. But I think it is not possible, for the glyph geometry depends on the font and whether the font sets a descender for CJK glyphs. I'm going to look for a better formula for computing texty that try to fix this problem. The calculation of the height of each glyph must be based on the variable of the current font currfont. Texty = y + (h + (dc.fonts->ascent + dc.fonts->descent))/2 - the problem with this formula of texty is that it depends solely on the first font, so if the user specify a CJK font before a Latin font, the problem will persist, and it will break the alignment if fonts with different geometries are used in sequence.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |