ChangeSet ID: 18092 CVSROOT: /opt/cvs-commit Module name: wine Changes by: julliard@wine.codeweavers.com 2005/06/12 05:43:24 Modified files: dlls/riched20 : style.c paint.c editor.c Log message: Krzysztof Foltman - added support for \ulnone (turning underline off) - support for basic subscript and superscript - untested support for text offset Patch: http://cvs.winehq.org/patch.py?id=18092 Old revision New revision Changes Path 1.5 1.6 +2 -0 wine/dlls/riched20/style.c 1.10 1.11 +11 -1 wine/dlls/riched20/paint.c 1.28 1.29 +15 -0 wine/dlls/riched20/editor.c Index: wine/dlls/riched20/style.c diff -u -p wine/dlls/riched20/style.c:1.5 wine/dlls/riched20/style.c:1.6 --- wine/dlls/riched20/style.c:1.5 Sat May 18 13:22:31 2013 +++ wine/dlls/riched20/style.c Sat May 18 13:22:31 2013 @@ -268,6 +268,8 @@ void ME_LogFontFromStyle(HDC hDC, LOGFON lf->lfUnderline = 1; if (s->fmt.dwEffects & s->fmt.dwMask & CFM_STRIKEOUT) lf->lfStrikeOut = 1; + if (s->fmt.dwEffects & s->fmt.dwMask & (CFM_SUBSCRIPT|CFM_SUPERSCRIPT)) + lf->lfHeight = (lf->lfHeight*2)/3; /*lf.lfQuality = PROOF_QUALITY; */ lf->lfPitchAndFamily = s->fmt.bPitchAndFamily; lf->lfCharSet = s->fmt.bCharSet; Index: wine/dlls/riched20/paint.c diff -u -p wine/dlls/riched20/paint.c:1.10 wine/dlls/riched20/paint.c:1.11 --- wine/dlls/riched20/paint.c:1.10 Sat May 18 13:22:31 2013 +++ wine/dlls/riched20/paint.c Sat May 18 13:22:31 2013 @@ -178,13 +178,23 @@ void ME_DrawTextWithStyle(ME_Context *c, HDC hDC = c->hDC; HGDIOBJ hOldFont; COLORREF rgbOld, rgbBack; + int yOffset = 0, yTwipsOffset = 0; hOldFont = ME_SelectStyleFont(c->editor, hDC, s); rgbBack = ME_GetBackColor(c->editor); if ((s->fmt.dwMask & CFM_COLOR) && (s->fmt.dwEffects & CFE_AUTOCOLOR)) rgbOld = SetTextColor(hDC, GetSysColor(COLOR_WINDOWTEXT)); else rgbOld = SetTextColor(hDC, s->fmt.crTextColor); - ExtTextOutW(hDC, x, y, 0, NULL, szText, nChars, NULL); + if ((s->fmt.dwMask & s->fmt.dwEffects) & CFM_OFFSET) { + yTwipsOffset = s->fmt.yOffset; + } + if ((s->fmt.dwMask & s->fmt.dwEffects) & (CFM_SUPERSCRIPT | CFM_SUBSCRIPT)) { + if (s->fmt.dwEffects & CFE_SUPERSCRIPT) yTwipsOffset = s->fmt.yHeight/3; + if (s->fmt.dwEffects & CFE_SUBSCRIPT) yTwipsOffset = -s->fmt.yHeight/12; + } + if (yTwipsOffset) + yOffset = yTwipsOffset*GetDeviceCaps(hDC, LOGPIXELSY)/1440; + ExtTextOutW(hDC, x, y-yOffset, 0, NULL, szText, nChars, NULL); if (width) { SIZE sz; GetTextExtentPoint32W(hDC, szText, nChars, &sz); Index: wine/dlls/riched20/editor.c diff -u -p wine/dlls/riched20/editor.c:1.28 wine/dlls/riched20/editor.c:1.29 --- wine/dlls/riched20/editor.c:1.28 Sat May 18 13:22:31 2013 +++ wine/dlls/riched20/editor.c Sat May 18 13:22:31 2013 @@ -321,11 +321,26 @@ void ME_RTFCharAttrHook(RTF_Info *info) case rtfUnderline: fmt.dwMask = CFM_UNDERLINE; fmt.dwEffects = info->rtfParam ? fmt.dwMask : 0; + fmt.bUnderlineType = CFU_CF1UNDERLINE; + break; + case rtfNoUnderline: + fmt.dwMask = CFM_UNDERLINE; + fmt.dwEffects = 0; break; case rtfStrikeThru: fmt.dwMask = CFM_STRIKEOUT; fmt.dwEffects = info->rtfParam ? fmt.dwMask : 0; break; + case rtfSubScript: + case rtfSuperScript: + case rtfSubScrShrink: + case rtfSuperScrShrink: + case rtfNoSuperSub: + fmt.dwMask = CFM_SUBSCRIPT|CFM_SUPERSCRIPT; + if (info->rtfMinor == rtfSubScrShrink) fmt.dwEffects = CFE_SUBSCRIPT; + if (info->rtfMinor == rtfSuperScrShrink) fmt.dwEffects = CFE_SUPERSCRIPT; + if (info->rtfMinor == rtfNoSuperSub) fmt.dwEffects = 0; + break; case rtfBackColor: fmt.dwMask = CFM_BACKCOLOR; fmt.dwEffects = 0;