Changeset ecc16fc in git


Ignore:
Timestamp:
14/06/10 06:21:40 (9 years ago)
Author:
Olly Betts <olly@…>
Branches:
add-show-splays, line_contents, master, stereo, svn/github/master, svn/origin/master, svn/survex-1_1, svn/tags/1.1.14, svn/tags/1.1.15, svn/tags/1.1.16, svn/tags/1.2.0, svn/tags/1.2.1, svn/tags/1.2.2, svn/tags/1.2.3, svn/tags/1.2.4, svn/tags/1.2.5, svn/tags/v1_1_13, svn/trunk, travis-osx
Children:
cfe20c7
Parents:
5f4a155
Message:

src/fnt.cc: Handle the left bearing and character width correctly.

git-svn-id: file:///home/survex-svn/survex/branches/survex-1_1@3403 4b37db11-9a0c-4f06-9ece-9ab7cdaee568

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    r5f4a155 recc16fc  
     1Mon Jun 14 05:20:44 GMT 2010  Olly Betts <olly@survex.com>
     2
     3        * src/fnt.cc: Handle the left bearing and character width correctly.
     4
    15Mon Jun 14 04:44:22 GMT 2010  Olly Betts <olly@survex.com>
    26
  • src/fnt.cc

    r5f4a155 recc16fc  
    44//  Draw text using texture mapped fonts.
    55//
    6 //  Copyright (C) 2003,2004,2006 Olly Betts
     6//  Copyright (C) 2003,2004,2006,2010 Olly Betts
    77//
    88//     Based on code from PLIB - http://plib.sourceforge.net
     
    178178        unsigned char h = fnt_readByte(fd);
    179179        int vtx_left = (signed char)fnt_readByte(fd);
    180         // We can't handle lbearing and rbearing correctly so ignore them.
    181         vtx_left = 0;
    182180        int vtx_bot = (signed char)fnt_readByte(fd);
    183         /* signed char step =*/ fnt_readByte(fd);
     181        signed char step = fnt_readByte(fd);
    184182        /* signed char unknown =*/ fnt_readByte(fd);
    185183        short x = fnt_readShort(fd);
     
    206204            glVertex2i(vtx_left, vtx_top);
    207205            glEnd();
    208             widths[ch] = w + 1;
    209         } else {
    210             widths[ch] = fnt_size / 2;
    211206        }
     207        widths[ch] = step;
    212208        glTranslated(widths[ch], 0, 0);
    213209        glEndList();
Note: See TracChangeset for help on using the changeset viewer.