Changeset 4162
- Timestamp:
- 2006年09月10日 21時52分34秒 (2 years ago)
- Files:
-
- trunk/src/ChangeLog.Meadow (modified) (1 diff)
- trunk/src/mw32font.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/ChangeLog.Meadow
r4161 r4162 1 2006-09-10 Masayuki FUJII <boochang@m4.kcn.ne.jp> 2 3 * mw32font.c (mw32_set_windows_logical_font): Correct the 4 calculation of overhang in non TrueType font. See ticket:136. 5 (mw32_glyph_metric): Correct lbearing and rbearing in non TrueType 6 font. See ticket:136. 7 1 8 2006-09-09 MIYOSHI Masanori <miyoshi@meadowy.org> 2 9 trunk/src/mw32font.c
r4152 r4162 232 232 pwf->cur_cm.width = w; 233 233 } 234 pwf->cur_cm.rbearing = 0; 235 pwf->cur_cm.lbearing = plf->overhang; 234 pwf->cur_cm.rbearing = pwf->cur_cm.width; 235 if (pwf->logfont.lfItalic) 236 pwf->cur_cm.rbearing += plf->overhang; 237 pwf->cur_cm.lbearing = 0; 236 238 } 237 239 pwf->cur_cm.ascent = plf->ascent; … … 385 387 386 388 pwf->pfont = hf; 389 pwf->ttfp = (tm.tmPitchAndFamily & TMPF_TRUETYPE); 387 390 388 391 plf->width = tm.tmAveCharWidth; … … 390 393 plf->ascent = tm.tmAscent; 391 394 plf->descent = tm.tmHeight - tm.tmAscent; 392 plf->overhang = tm.tmOverhang; 395 396 if (!pwf->ttfp 397 && plogf->lfWeight != FW_NORMAL && plogf->lfWeight != FW_DONTCARE) 398 { 399 HFONT hf_normal; 400 LOGFONT logf_normal = *plogf; 401 402 /* For bold string in non TrueType font, the value of 403 overhang includes offset of overstrike. */ 404 logf_normal.lfWeight = FW_NORMAL; 405 406 if (!(hf_normal = CreateFontIndirect (&logf_normal))) 407 { 408 xfree (pwf); 409 return 0; 410 } 411 412 HDC hdc; 413 HANDLE oldobj; 414 TEXTMETRIC tm_normal; 415 int flag; 416 417 hdc = GET_FRAME_HDC (f); 418 oldobj = SelectObject (hdc, hf_normal); 419 flag = GetTextMetrics (hdc, &tm_normal); 420 SelectObject (hdc, oldobj); 421 RELEASE_FRAME_HDC (f); 422 423 DeleteObject (hf_normal); 424 425 if (!flag) 426 { 427 xfree (pwf); 428 return 0; 429 } 430 431 plf->overhang = tm_normal.tmOverhang; 432 } 433 else 434 plf->overhang = tm.tmOverhang; 435 393 436 plf->fixed_pitch = !(tm.tmPitchAndFamily & TMPF_FIXED_PITCH); 394 437 mw32_windows_set_logical_font_from_char (plf, c); … … 397 440 plf->character_spacing = 0; 398 441 plf->centering = 0; 399 400 pwf->ttfp = (tm.tmPitchAndFamily & TMPF_TRUETYPE);401 442 } 402 443 else
