Merge GSLayoutManager.m with GUI trunk revision 40273

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@40277 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Marcian Lytwyn 2016-12-22 19:13:26 +00:00
parent d637b46e7f
commit e59e74cb90

View file

@ -986,43 +986,6 @@ Fills in all glyph holes up to last. only looking at levels below level
return cpos + r->glyphs[glyphIndex - pos].char_offset;
}
/**
* GNUstep extension
*/
- (NSSize) advancementForGlyphAtIndex: (unsigned int)glyphIndex
{
glyph_run_t *r;
unsigned int pos, cpos;
if (glyphs->glyph_length <= glyphIndex)
{
[self _generateGlyphsUpToGlyph: glyphIndex];
if (glyphs->glyph_length <= glyphIndex)
{
[NSException raise: NSRangeException
format: @"%s glyph index out of range", __PRETTY_FUNCTION__];
return NSMakeSize(0,0);
}
}
r = run_for_glyph_index(glyphIndex, glyphs, &pos, &cpos);
if (!r)
{
[NSException raise: NSRangeException
format: @"%s glyph index out of range", __PRETTY_FUNCTION__];
return NSMakeSize(0,0);
}
if (r->head.glyph_length <= glyphIndex - pos)
{
[NSException raise: NSRangeException
format: @"%s internal error!", __PRETTY_FUNCTION__];
return NSMakeSize(0,0);
}
return r->glyphs[glyphIndex - pos].advancement;
}
- (NSRange) characterRangeForGlyphRange: (NSRange)glyphRange
actualGlyphRange: (NSRange *)actualGlyphRange
{
@ -1679,6 +1642,15 @@ places where we switch.
return r->font;
}
/**
* GNUstep extension
*/
- (NSSize) advancementForGlyphAtIndex: (unsigned int)idx
{
GET_GLYPH
return r->glyphs[idx].advancement;
}
- (void) insertGlyph: (NSGlyph)aGlyph
atGlyphIndex: (unsigned int)glyphIndex
characterIndex: (unsigned int)charIndex
@ -3253,7 +3225,14 @@ forStartingGlyphAtIndex: (NSUInteger)glyph
for (i=0; i<length; i++)
{
advances[i] = [run->font advancementForGlyph: glyph_list[i]];
if ((glyph_list[i] != NSControlGlyph) && (glyph_list[i] != GSAttachmentGlyph))
{
advances[i] = [run->font advancementForGlyph: glyph_list[i]];
}
else
{
advances[i] = NSZeroSize;
}
}
[self insertGlyphs: glyph_list