Tk Source Code

Check-in [f4972dda]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:make tkUnixRFont.c compile again. See: [e1b1dd7bbfcad23066]: trunk/revised_text: compilation error
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | revised_text | tip-466
Files: files | file ages | folders
SHA3-256: f4972ddaee8ca83be4d405fa3468fea9cbdf8eccb0b8d519869bc385ab67eb29
User & Date: jan.nijtmans 2018-10-19 21:34:11
Context
2018-10-19
21:40
Fix [7ef5bdc18527dcaa3ab]: trunk/revised_text : mac os x: compilation warnings check-in: 25a4eae2 user: jan.nijtmans tags: revised_text, tip-466
21:34
make tkUnixRFont.c compile again. See: [e1b1dd7bbfcad23066]: trunk/revised_text: compilation error check-in: f4972dda user: jan.nijtmans tags: revised_text, tip-466
20:01
Merge trunk. And various fixes which make it compile again on win32, unix and macosx check-in: 90b81130 user: jan.nijtmans tags: revised_text, tip-466
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to unix/tkUnixRFont.c.

618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
...
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
 *
 *	Retrieve the font attributes of the actual font used to render a given
 *	character.
 *
 *----------------------------------------------------------------------
 */

/* we need backward compatibility */
#if TK_MAJOR_VERSION == 8 && TK_MINOR_VERSION < 7
# define UNICHAR Tcl_UniChar
# define TkUtfToUniChar Tcl_UtfToUniChar
#else /* if !(TK_MAJOR_VERSION == 8 && TK_MINOR_VERSION < 7) */
# define UNICHAR int
# if TCL_UTF_MAX > 4
#  define TkUtfToUniChar Tcl_UtfToUniChar
# else /* if TCL_UTF_MAX <= 4 */
extern int TkUtfToUniChar(const char *src, int *chPtr);
# endif /* TCL_UTF_MAX > 4 */
#endif /* TK_MAJOR_VERSION == 8 && TK_MINOR_VERSION < 7 */

void
TkpGetFontAttrsForChar(
    Tk_Window tkwin,		/* Window on the font's display */
    Tk_Font tkfont,		/* Font to query */
    UNICHAR c,			/* Character of interest */
    TkFontAttributes *faPtr)	/* Output: Font attributes */
{
    UnixFtFont *fontPtr = (UnixFtFont *) tkfont;
				/* Structure describing the logical font */
    FcChar32 ucs4 = (FcChar32) c;
				/* UCS-4 character to map */
    XftFont *ftFont = GetFont(fontPtr, ucs4, 0.0);
................................................................................
    int len = 0;
#endif /* DEBUG_FONTSEL */

    curX = 0;
    curByte = 0;
    sawNonSpace = 0;
    while (numBytes > 0) {
	UNICHAR unichar;

	clen = TkUtfToUniChar(source, &unichar);
	c = (FcChar32) unichar;

	if (clen <= 0) {
	    /*
	     * This can't happen (but see #1185640)






<
<
<
<
<
<
<
<
<
<
<
<
<




|







 







|







618
619
620
621
622
623
624













625
626
627
628
629
630
631
632
633
634
635
636
...
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
 *
 *	Retrieve the font attributes of the actual font used to render a given
 *	character.
 *
 *----------------------------------------------------------------------
 */














void
TkpGetFontAttrsForChar(
    Tk_Window tkwin,		/* Window on the font's display */
    Tk_Font tkfont,		/* Font to query */
    int c,			/* Character of interest */
    TkFontAttributes *faPtr)	/* Output: Font attributes */
{
    UnixFtFont *fontPtr = (UnixFtFont *) tkfont;
				/* Structure describing the logical font */
    FcChar32 ucs4 = (FcChar32) c;
				/* UCS-4 character to map */
    XftFont *ftFont = GetFont(fontPtr, ucs4, 0.0);
................................................................................
    int len = 0;
#endif /* DEBUG_FONTSEL */

    curX = 0;
    curByte = 0;
    sawNonSpace = 0;
    while (numBytes > 0) {
	int unichar;

	clen = TkUtfToUniChar(source, &unichar);
	c = (FcChar32) unichar;

	if (clen <= 0) {
	    /*
	     * This can't happen (but see #1185640)