Changeset 3368

Show
Ignore:
Timestamp:
2004年07月24日 10時06分11秒 (4 years ago)
Author:
miyoshi
Message:

(mw32_set_windows_logical_font): If the font width is
not desired, adjust `lfWidth' and recreate it later.
(mw32_convert_lface_to_LOGFONT): Set lfHeight to positive value.
(mw32_initialize_default_logfont): The height is explicitly set
here to avoid the annoying variable font width.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/2.1/src/ChangeLog.Meadow

    r3366 r3368  
     12004-07-24  MIYOSHI Masanori  <miyoshi@meadowy.org> 
     2 
     3        * mw32font.c (mw32_set_windows_logical_font): If the font width is 
     4        not desired, adjust `lfWidth' and recreate it later. 
     5        (mw32_convert_lface_to_LOGFONT): Set lfHeight to positive value. 
     6        (mw32_initialize_default_logfont): The height is explicitly set 
     7        here to avoid the annoying variable font width. 
     8 
    192004-07-20  MIYOSHI Masanori  <miyoshi@meadowy.org> 
    210 
  • branches/2.1/src/mw32font.c

    r3366 r3368  
    408408          return 0; 
    409409        } 
     410      /* If the font width is not desired, adjust `lfWidth' and 
     411         recreate it later. */ 
     412      if (plogf->lfWidth != 0 && plogf->lfWidth != tm.tmAveCharWidth) 
     413        { 
     414          int target_width = plogf->lfWidth; 
     415          plogf->lfWidth = plogf->lfWidth * plogf->lfWidth / tm.tmAveCharWidth; 
     416          tm.tmAveCharWidth = target_width; 
     417          DeleteObject (hf); 
     418          hf = INVALID_HANDLE_VALUE; 
     419        } 
     420       
    410421      pwf->pfont = hf; 
    411422 
     
    17571768      else if (FLOATP (elt)) 
    17581769        pt = (int) XFLOATINT (elt); 
    1759       plogf->lfHeight = (int)(- pt * FRAME_MW32_DISPLAY_INFO (f)->resy / 720); 
     1770      /* I want this value to be a cell height that includes internal 
     1771         leading, so this should be positive. */ 
     1772      plogf->lfHeight = (int)(pt * FRAME_MW32_DISPLAY_INFO (f)->resy / 720); 
    17601773    } 
    17611774 
     
    18361849  static LOGFONT default_logfont = 
    18371850    { 
    1838       0, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, DEFAULT_CHARSET, 
     1851      /* The height is explicitly set here to avoid the annoying 
     1852         variable font width. */ 
     1853      16, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, DEFAULT_CHARSET, 
    18391854      OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, 
    18401855      FF_DONTCARE | FIXED_PITCH, ""