www.pudn.com > cwin.rar > DRAWXYST.C


    /*----------------------------------------------------------- 
        函数 drawxystr : 显示汉字字符串 
    -----------------------------------------------------------*/ 
    #include  
    #include  
 
    void _Cdecl drawxystr(x,y,color,s) 
    int x,y;                                     /* 字符串的坐标      */ 
    int color;                                   /* 字符串的颜色      */ 
    char *s;                                     /* 字符串指针        */ 
    { 
        int width = _CurrentHZK->fontwidth;      /* 汉字字模宽        */ 
        int high  = _CurrentHZK->fonthigh;       /* 汉字字模高        */ 
        unsigned h; 
        while((s=takehan(s,&h))!=NULL)           /* 分解字符串        */ 
        { 
            if(isSP(h) && takefont(h))   /* h为汉字机内码且读字模成功 */ 
            { 
                _DrawFont(x,y,width,high,color,_HanFont); 
                x += width*8*_Xtimes; 
            } 
            else if(h<256)               /* h为西文字符或扩展ASCII码  */ 
            { 
                memmove(_HanFont,_ChrFont+h*CHAR_HIGH,CHAR_HIGH); 
                _DrawFont(x,y,1,CHAR_HIGH,color,_HanFont); 
                x += 8*_Xtimes; 
            } 
        } 
    }