Commit 8720c9a0 authored by rjw's avatar rjw
Browse files

Fixed many font substitution related bugs, at least including:

        3006966, 3026675, 3071106, and more... (each of these bugs
        has a list of related bugs).

        Needs little more cleanup to correctly deal with non base characters.

        * WebCoreSupport.subproj/WebTextRenderer.h:
        * WebCoreSupport.subproj/WebTextRenderer.m:
        (-[WebTextRenderer drawCharacters:stringLength:fromCharacterPosition:toCharacterPosition:atPoint:withPadding:withTextColor:backgroundColor:]):
        (-[WebTextRenderer floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:withPadding:applyRounding:attemptFontSubstitution:widths:]):
        (-[WebTextRenderer _floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:withPadding:applyRounding:attemptFontSubstitution:widths:fonts:glyphs:numGlyphs:]):

        Against Darin's better judgement prevent extra layout when not in live resize.  If
        this introduces any regressions I owe darin a good bottle of wine.

        * WebView.subproj/WebDynamicScrollBarsView.m:
        (-[WebDynamicScrollBarsView updateScrollers]):

        Updated to reflect new calling parameter semantic of floatCharacterWidths(),
        which now returns the entire array of widths up the last character requested.

        * khtml/rendering/render_text.cpp:
        (TextSlave::checkSelectionPoint):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2462 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent d233e0b5
2002-10-24 Richard Williamson <rjw@apple.com>
Updated to reflect new calling parameter semantic of floatCharacterWidths(),
which now returns the entire array of widths up the last character requested.
* khtml/rendering/render_text.cpp:
(TextSlave::checkSelectionPoint):
2002-10-24 David Hyatt <hyatt@apple.com>
 
<pre>, <xmp> and <plaintext> should all have a top margin of 1em.
......
2002-10-24 Richard Williamson <rjw@apple.com>
Updated to reflect new calling parameter semantic of floatCharacterWidths(),
which now returns the entire array of widths up the last character requested.
* khtml/rendering/render_text.cpp:
(TextSlave::checkSelectionPoint):
2002-10-24 David Hyatt <hyatt@apple.com>
 
<pre>, <xmp> and <plaintext> should all have a top margin of 1em.
......
2002-10-24 Richard Williamson <rjw@apple.com>
Updated to reflect new calling parameter semantic of floatCharacterWidths(),
which now returns the entire array of widths up the last character requested.
* khtml/rendering/render_text.cpp:
(TextSlave::checkSelectionPoint):
2002-10-24 David Hyatt <hyatt@apple.com>
 
<pre>, <xmp> and <plaintext> should all have a top margin of 1em.
......
......@@ -161,7 +161,7 @@ FindSelectionResult TextSlave::checkSelectionPoint(int _x, int _y, int _tx, int
#if APPLE_CHANGES
// Floating point version needed for best results with Mac OS X text.
float delta = _x - (_tx + m_x);
float widths[m_len];
float widths[text->str->l];
// Do width calculations for whole run once.
f->floatCharacterWidths( text->str->s, text->str->l, m_start, m_len, m_toAdd, &widths[0]);
......@@ -169,7 +169,7 @@ FindSelectionResult TextSlave::checkSelectionPoint(int _x, int _y, int _tx, int
if ( m_reversed ) {
delta -= m_width;
while(pos < m_len) {
float w = widths[pos];
float w = widths[pos+m_start];
float w2 = w/2;
w -= w2;
delta += w2;
......@@ -180,7 +180,7 @@ FindSelectionResult TextSlave::checkSelectionPoint(int _x, int _y, int _tx, int
}
} else {
while(pos < m_len) {
float w = widths[pos];
float w = widths[pos+m_start];
float w2 = w/2;
w -= w2;
delta -= w2;
......
2002-10-24 Richard Williamson <rjw@apple.com>
Fixed many font substitution related bugs, at least including:
3006966, 3026675, 3071106, and more...
* WebCoreSupport.subproj/WebTextRenderer.h:
* WebCoreSupport.subproj/WebTextRenderer.m:
(-[WebTextRenderer drawCharacters:stringLength:fromCharacterPosition:toCharacterPosition:atPoint:withPadding:withTextColor:backgroundColor:]):
(-[WebTextRenderer floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:withPadding:applyRounding:attemptFontSubstitution:widths:]):
(-[WebTextRenderer _floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:withPadding:applyRounding:attemptFontSubstitution:widths:fonts:glyphs:numGlyphs:]):
Against Darin's better judgement prevent extra layout when not in live resize. If
this introduces any regressions I owe darin a good bottle of wine.
* WebView.subproj/WebDynamicScrollBarsView.m:
(-[WebDynamicScrollBarsView updateScrollers]):
2002-10-24 Chris Blumenberg <cblu@apple.com>
 
New Java plug-in works! Much faster to load and no spinny cursor! Unfortunately, it very unstable.
......
2002-10-24 Richard Williamson <rjw@apple.com>
Fixed many font substitution related bugs, at least including:
3006966, 3026675, 3071106, and more...
* WebCoreSupport.subproj/WebTextRenderer.h:
* WebCoreSupport.subproj/WebTextRenderer.m:
(-[WebTextRenderer drawCharacters:stringLength:fromCharacterPosition:toCharacterPosition:atPoint:withPadding:withTextColor:backgroundColor:]):
(-[WebTextRenderer floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:withPadding:applyRounding:attemptFontSubstitution:widths:]):
(-[WebTextRenderer _floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:withPadding:applyRounding:attemptFontSubstitution:widths:fonts:glyphs:numGlyphs:]):
Against Darin's better judgement prevent extra layout when not in live resize. If
this introduces any regressions I owe darin a good bottle of wine.
* WebView.subproj/WebDynamicScrollBarsView.m:
(-[WebDynamicScrollBarsView updateScrollers]):
2002-10-24 Chris Blumenberg <cblu@apple.com>
 
New Java plug-in works! Much faster to load and no spinny cursor! Unfortunately, it very unstable.
......
//
// WebTextRenderer.h
// WebKit
//
// Created by Darin Adler on Thu May 02 2002.
// Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
//
/*
WebTextRenderer.h
Copyright 2002, Apple, Inc. All rights reserved.
*/
#import <WebCore/WebCoreTextRenderer.h>
......@@ -30,4 +27,6 @@ typedef struct GlyphMap GlyphMap;
- initWithFont:(NSFont *)font;
- (float)_floatWidthForCharacters:(const UniChar *)characters stringLength:(unsigned)stringLength fromCharacterPosition: (int)pos numberOfCharacters: (int)len withPadding: (int)padding applyRounding: (BOOL)applyRounding attemptFontSubstitution: (BOOL)attemptSubstitution widths: (float *)widthBuffer fonts: (NSFont **)fontBuffer glyphs: (CGGlyph *)glyphBuffer numGlyphs: (int *)_numGlyphs;
@end
......@@ -33,7 +33,7 @@ - (void)updateScrollers
// Do a layout if pending, before checking if scrollbars are needed.
// This fixes 2969367, although may introduce a slowdown in live resize performance.
NSView *documentView = [self documentView];
if ([documentView conformsToProtocol:@protocol(WebDocumentView)]) {
if ([documentView inLiveResize] && [documentView conformsToProtocol:@protocol(WebDocumentView)]) {
[(id <WebDocumentView>)documentView layout];
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment