| 754 | } |
| 755 | |
| 756 | void CTxtWinHost::SetFont(HFONT hFont) |
| 757 | { |
| 758 | if( hFont == NULL ) return; |
| 759 | LOGFONT lf; |
| 760 | ::GetObject(hFont, sizeof(LOGFONT), &lf); |
| 761 | LONG yPixPerInch = ::GetDeviceCaps(m_re->GetManager()->GetPaintDC(), LOGPIXELSY); |
| 762 | cf.yHeight = -lf.lfHeight * LY_PER_INCH / yPixPerInch; |
| 763 | if(lf.lfWeight >= FW_BOLD) |
| 764 | cf.dwEffects |= CFE_BOLD; |
| 765 | if(lf.lfItalic) |
| 766 | cf.dwEffects |= CFE_ITALIC; |
| 767 | if(lf.lfUnderline) |
| 768 | cf.dwEffects |= CFE_UNDERLINE; |
| 769 | cf.bCharSet = lf.lfCharSet; |
| 770 | cf.bPitchAndFamily = lf.lfPitchAndFamily; |
| 771 | #ifdef _UNICODE |
| 772 | _tcscpy(cf.szFaceName, lf.lfFaceName); |
| 773 | #else |
| 774 | //need to thunk pcf->szFaceName to a standard char string.in this case it's easy because our thunk is also our copy |
| 775 | MultiByteToWideChar(CP_ACP, 0, lf.lfFaceName, LF_FACESIZE, cf.szFaceName, LF_FACESIZE) ; |
| 776 | #endif |
| 777 | |
| 778 | pserv->OnTxPropertyBitsChange(TXTBIT_CHARFORMATCHANGE, |
| 779 | TXTBIT_CHARFORMATCHANGE); |
| 780 | } |
| 781 | |
| 782 | void CTxtWinHost::SetColor(DWORD dwColor) |
| 783 | { |
nothing calls this directly
no test coverage detected