Fonts: - fonts/hack: Hack 3.003 (Expat + Bitstream Vera, from Debian fonts-hack), installed to dt/fonts; config/fonts.conf (the system's fontconfig plus that directory) exported by Xsession.d/0070.dtfonts and Dtlogin*environment. - sys.resources and dtlogin Xresources: Xft render tables in Hack 10 for renderTable, textRenderTable, labelRenderTable, buttonRenderTable (a render table wins over sys.font's *FontList; dtterm and text fields read the text table). dtterm (ported from MakroDE -- setlocale and the Xft renderer -- then fixed): - configure: Xft on by default, --disable-xft for machines without it. - TermPrimRenderXft.c: reads wchar_t in multibyte locales (it read the buffer as UTF-8 bytes: three boxes after every character), places every character in its cell on the baseline, fills the background, draws underline/overstrike/secure, wcwidth for wide and combining characters, borrows glyphs from fontconfig fallbacks (check mark, CJK), and makes its XftDraw at the first drawing (made in Initialize it was window 0, and the first string a BadDrawable that ended dtterm). - TermPrim.c AdjustWindowUnits: the cell from the renderer's extents when there is no XFontStruct (crashed with Xft); _DtTermPrimRenderFontExtents. - TermPrimRenderFont.c: with setlocale the buffer is wchar_t in UTF-8, the single-font renderer draws it as XChar2b (it drew boxes too). Screenshots: build/mcde-shots/dtterm-utf8b-crop.png, dtterm-classic-crop.png. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
94 lines
3.3 KiB
C
94 lines
3.3 KiB
C
/*
|
|
* CDE - Common Desktop Environment
|
|
*
|
|
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
|
|
*
|
|
* These libraries and programs are free software; you can
|
|
* redistribute them and/or modify them under the terms of the GNU
|
|
* Lesser General Public License as published by the Free Software
|
|
* Foundation; either version 2 of the License, or (at your option)
|
|
* any later version.
|
|
*
|
|
* These libraries and programs are distributed in the hope that
|
|
* they will be useful, but WITHOUT ANY WARRANTY; without even the
|
|
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
* PURPOSE. See the GNU Lesser General Public License for more
|
|
* details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
* License along with these libraries and programs; if not, write
|
|
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
|
|
* Floor, Boston, MA 02110-1301 USA
|
|
*/
|
|
/*
|
|
* $XConsortium: TermPrimRender.h /main/1 1996/04/21 19:18:43 drk $";
|
|
*/
|
|
/* *
|
|
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
|
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
|
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
|
* (c) Copyright 1993, 1994 Novell, Inc. *
|
|
*/
|
|
#ifndef _Dt_TermPrimRender_h
|
|
#define _Dt_TermPrimRender_h
|
|
|
|
typedef struct _TermFontRec *TermFont;
|
|
|
|
extern void _DtTermPrimRenderText(
|
|
Widget w,
|
|
TermFont font,
|
|
Pixel fg,
|
|
Pixel bg,
|
|
unsigned long flags,
|
|
int x,
|
|
int y,
|
|
unsigned char *string,
|
|
int len
|
|
);
|
|
|
|
extern void _DtTermPrimDestroyFont(
|
|
Widget w,
|
|
TermFont font
|
|
);
|
|
|
|
extern void _DtTermPrimBell(Widget w);
|
|
extern void _termSetRenderFont(Widget w, TermFont *termFont);
|
|
extern void _termSetBufferSize(Widget w, int width, int height,
|
|
int xOffset, int yOffset);
|
|
extern void _termFreeBuffer(Widget w);
|
|
extern void _DtTermPrimRefreshText(Widget w,
|
|
short startColumn, short startRow,
|
|
short endColumn, short endRow);
|
|
extern void _DtTermPrimExposeText(Widget w, int startX, int startY, int endX,
|
|
int endY, Boolean isExposeEvent);
|
|
extern int _DtTermPrimInsertText(Widget w, unsigned char *buffer, int length);
|
|
extern int _DtTermPrimInsertTextWc(Widget w, wchar_t *buffer, int length);
|
|
extern void _DtTermPrimRefreshTextWc(Widget w, short startColumn,
|
|
short startRow, short endColumn, short endRow);
|
|
|
|
extern Boolean
|
|
_DtTermPrimParseInput
|
|
(
|
|
Widget w,
|
|
unsigned char *buffer,
|
|
int len,
|
|
unsigned char **dangleBuffer,
|
|
int *dangleBufferLen
|
|
);
|
|
|
|
extern void _DtTermPrimCursorOff(Widget w);
|
|
extern void _DtTermPrimCursorOn(Widget w);
|
|
extern void _DtTermPrimCursorChangeFocus(Widget w);
|
|
extern XtInputCallbackProc _termReadPty(XtPointer client_data, int *source,
|
|
XtInputId *id);
|
|
extern void _termCompleteScroll(Widget w);
|
|
extern void _DtTermPrimFillScreenGap(Widget w);
|
|
extern void _DtTermPrimRenderPadLine(Widget w);
|
|
/* MCDE: the extents of a run in FONT, through the renderer that made it (an
|
|
* Xft font has no XFontStruct the caller could measure) */
|
|
extern void _DtTermPrimRenderFontExtents(Widget w, TermFont font,
|
|
unsigned char *string, int len, int *widthReturn, int *heightReturn,
|
|
int *ascentReturn);
|
|
#endif /* _Dt_TermPrimRender_h */
|
|
/* DON'T ADD ANYTHING AFTER THIS #endif... */
|