Closed
Bug 161332
Opened 23 years ago
Closed 20 years ago
Need to use ATSUGetUnjustifiedBounds instead of ATSUMeasureText
Categories
(Core :: Internationalization, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: bnesse, Assigned: jhpedemonte)
References
Details
(Keywords: intl)
Attachments
(1 file, 2 obsolete files)
6.75 KB,
patch
|
asaf
:
review+
peterv
:
superreview+
|
Details | Diff | Splinter Review |
I think this belongs to Frank... my apologies if I am incorrect.
Launching Mozilla under Jaguar throws the following warning: *** Warning:
ATSUMeasureText has been deprecated. Use ASUGetUnjustifiedBounds instead.
I expect this will need to be fixed.
Code issue, QA to yokoyama@netscape.com for now.
Keywords: intl
QA Contact: ruixu → yokoyama
Comment 2•23 years ago
|
||
I search www.google.com, I can find ATSUMeasureText from apple
I cannot find ASUGetUnjustifiedBounds from anywhere
If they want to migrate the api, they should at least make the documentation
available.
Comment 3•23 years ago
|
||
according to xavier ASUGetUnjustifiedBounds take exactly the same argument as
ATSUMeasureText
Status: NEW → ASSIGNED
Comment 4•23 years ago
|
||
Comment 5•23 years ago
|
||
bnesse: will this work ?
(does it compile ? :) )
Would switching cut off 10.1 users? If so, this should be postponed until it
buys something real.
Even the Carbon docs on the Tools disc that comes with Jag makes no mention of
ATSUGetUnjustifiedBounds, and ATSUMeasureText is tagged as "Supported".
I'm sorry, ignore the idiot in the corner. I missed the #define.
Comment 8•23 years ago
|
||
*** Bug 170166 has been marked as a duplicate of this bug. ***
Reporter | ||
Comment 9•23 years ago
|
||
Sorry for the delay. The patch does not compile because
"ATSUGetUnjustifiedBounds" isn't in the current universal header files.
Finally documented in:
http://developer.apple.com/techpubs/macosx/Carbon/text/ATSUI/ATSUI_Reference/atsui_reference.pdf
(pg 158 currently).
note the Availability section says:
"Not supported in Carbon. Not available in CarbonLib. Available in Mac OS X
10.2 and later."
Comment 11•22 years ago
|
||
*** Bug 221590 has been marked as a duplicate of this bug. ***
Comment 12•22 years ago
|
||
Note that patch attached to bug 221590 , has been applied and does compile.
Comment 13•21 years ago
|
||
Ludovic, may I suggest that you move your patch from that dup to this bug so that it doesn't get
lost in the noise?
Also, anyone who is interested in this bug might want to check out bug #227295. It's quasi-
related. It deals with the deprecation of the ATSUSetFontFallbacks.
I tend to doubt Mozilla will drop support for 10.1 any time soon, so I propose the following
solutions:
1. I think there's a #define MACOS_DEPLOYMENT_TARGET that we can use for a compile-time
usage. Something like:
#if MACOS_DEPLOYMENT_TARGET < 100200
#define _HAVE_ATSUMEASURETEXT
#else
#define _HAVE_ATSUGETUNJUSTIFIEDBOUNDS
#endif
Then in the code, use the appropriate call accordingly.
2. Implement some kind of runtime check. Check out Darin Fisher's patch for getaddrinfo usage on
Mac OS X in bug #222031 for a similar runtime check. This would be the more optimal solution, I
think.
Comment 14•21 years ago
|
||
Comment 15•21 years ago
|
||
(In reply to comment #13)
> I tend to doubt Mozilla will drop support for 10.1 any time soon, so I propose
the following
> solutions:
Yep And I wonder how many people still use 10.1 ?
> 2. Implement some kind of runtime check. Check out Darin Fisher's patch for
getaddrinfo usage on
> Mac OS X in bug #222031 for a similar runtime check. This would be the more
optimal solution, I
> think.
How much more code does this generates ? How much bigger are the binaries ?
(In reply to comment #15)
> Yep And I wonder how many people still use 10.1 ?
I looked at the talkback data on the ftp server and it would have you believe
everybody is running Jaguar. (Darwin 6.6) I guess that's not a great measure.
Comment 17•21 years ago
|
||
Is anybody still working on this bug? The people it's assigned to don't have
valid email addresses anymore.
The bug's still open, of course; I found it while preparing to file my own bug
report. Not a showstopper by any stretch, but best to keep the warnings down.
Comment 18•21 years ago
|
||
*** Bug 251957 has been marked as a duplicate of this bug. ***
Updated•21 years ago
|
Flags: blocking-aviary1.0mac?
Updated•21 years ago
|
Flags: blocking-aviary1.0mac? → blocking-aviary1.0mac-
Comment 19•21 years ago
|
||
This issue still occurs in Mac OS X 10.3.4 with Mozilla 1.7.2.
Aug 20 10:22:32 /Applications/Mozilla.app/Contents/MacOS/mozilla-bin: ***
Warning: ATSUMeasureText has been deprecated. Use ATSUGetUnjustifiedBounds
instead. ***
Updated•21 years ago
|
Assignee: ftang → qa-mozilla
Status: ASSIGNED → NEW
Comment 20•21 years ago
|
||
This issue still occurs in Mac OS X 10.3.5 with Firefox 1.0PR.
Oct 1 14:09:54 localhost /Applications/Firefox.app/Contents/MacOS/firefox-bin:
*** Warning: ATSUMeasureText has been deprecated. Use ATSUGetUnjustifiedBounds
instead. ***
Also, I have noticed that since recent Apple patches, the cursor position in
Firefox tends to get VERY messed up (e.g. does not line up with text properly;
can be way to the left or right of REAL position). I'm guessing that this issue
is the culprit (that is, on 10.3.x, Apple implemented something about
ATSUMeasureText incorrectly so it returns bogus values causing the cursor to get
messed up; presumably ATSUGetUnjustifiedBounds would fix the issue. A runtime
check of OS version would be necessary to maintain compatibility.)
References:
http://developer.apple.com/documentation/Carbon/Reference/ATSUI_Reference/atsu_reference_Reference/function_group_13.html#//apple_ref/doc/uid/TP30000309/ATSUGetUnjustifiedBounds
http://developer.apple.com/documentation/Carbon/Reference/ATSUI_Legacy/atsu_legacy_Reference/FunctionGroupIndex.html#//apple_ref/doc/c_ref/ATSUMeasureText
(In reply to comment #19)
> This issue still occurs in Mac OS X 10.3.4 with Mozilla 1.7.2.
>
> Aug 20 10:22:32 /Applications/Mozilla.app/Contents/MacOS/mozilla-bin: ***
> Warning: ATSUMeasureText has been deprecated. Use ATSUGetUnjustifiedBounds
> instead. ***
Comment 21•21 years ago
|
||
For this to be fixed elegantly , the Mozilla Foundation needs to say if they
want to support os X 10.1 in the future or not.
Comment 22•20 years ago
|
||
Abandoning 10.1 is not out of the question, 10.2 is the first really stable
version of OS X and there's almost no systems that can run 10.1 that wouldn't be
faster and more reliable on Jaguar. 10.2 is supported (as in, Apple says it'll
run) on all the same platforms as 10.1. It does need a G3, while 10.1 will run
on later pre-G3 Macs with the help of XPostFacto. But... Apple only made a few
604e-based machines with the kind of performance OS X really needs. 10.1 on a
7600/180 is not a practical platform for Firefox.
10.2 is a different story: Panther dropped the first generation G3 macs, and
XPostFacto doesn't seem to always work. There's a huge number of Beige G3s out
there, and many of them are limited to Jaguar.
(In reply to comment #22)
> But... Apple only made a few
> 604e-based machines with the kind of performance OS X really needs. 10.1 on a
> 7600/180 is not a practical platform for Firefox.
How would we make a request to get data from Talkback re: OS version and CPU model?
Comment 24•20 years ago
|
||
To get the CPU type you may be able to use arch(3): NXGetLocalArchInfo(), use
"man 3 arch" for more information.
For the kernel version, uname should work:
Mac OS X Public Beta: Darwin 1.2.1
Mac OS X 10.0 (Cheetah): Darwin 1.3.1
Mac OS X 10.1 (Puma): Darwin 1.4.1
Mac OS X 10.2 (Jaguar): Darwin 6.x
Mac OS X 10.3 (Panther): Darwin 7.x
Perhaps I was unclear. I'm talking about the Talkback database - if we assume
crashes are not CPU-specific, we should be able to get a feel for what
percentage of users is running Mozilla on a pre-G3 machine. The results may
influence whether we can drop 10.1 support.
Comment 26•20 years ago
|
||
Comment on attachment 140509 [details] [diff] [review]
Patch from duplicated bug
bill: surveying users is silly. just write a patch which dynamically probes the
right library for the function, if it gets it, use it, if not, fall back to the
older function.
Attachment #140509 -
Flags: review-
Comment 27•20 years ago
|
||
Bill: if it says "Darwin 6.6" that means that it's 10.2.6. I'm at 10.2.8 and
uname says:
Darwin bastard.in.taronga.com 6.8 Darwin Kernel Version 6.8: Wed Sep 10 15:20:55
PDT 2003; root:xnu/xnu-344.49.obj~2/RELEASE_PPC Power Macintosh powerpc
The complete list is at, among other places,
http://www.opensource.apple.com/darwinsource/ .
Apparently, OS X 10.1.1 is where the numbering scheme changed from "Darwin
1.x.y" to "Darwin x.y", and they never did a dource release for the public beta.
Assignee | ||
Comment 28•20 years ago
|
||
This patch dynamically loads the functions. Loading of
ATSUGetUnjustifiedBounds should fail on 10.1, so we default to using
ATSUMeasureText. Have a go.
Attachment #95553 -
Attachment is obsolete: true
Attachment #140509 -
Attachment is obsolete: true
Assignee | ||
Updated•20 years ago
|
Attachment #168781 -
Flags: review?(bugs.mano)
Comment 29•20 years ago
|
||
Comment on attachment 168781 [details] [diff] [review]
patch for 10.1 and 10.2+
We really need to clean up this and similar bits [e.g. bug 266551] when we drop
support for 10.1.
> ATSUILayoutCache* nsATSUIUtils::gTxLayoutCache = nsnull;
>
> PRBool nsATSUIUtils::gIsAvailable = PR_FALSE;
> PRBool nsATSUIUtils::gInitialized = PR_FALSE;
>
>+fpMeasureText_type nsATSUIUtils::fpMeasureText = NULL;
>+
nsnull
> if (noErr != err) {
>- NS_WARNING("ATSUMeasureText failed");
>+ NS_WARNING("MeasureText failed");
> return NS_ERROR_FAILURE;
> }
Although we don't support building on 10.1, "ATSUGetUnjustifiedBounds /
ATSUMeasureText (10.1)" would be better.
otherwise, r=bugs.mano@mail-central.com
Attachment #168781 -
Flags: review?(bugs.mano) → review+
Updated•20 years ago
|
Assignee: qa-mozilla → jhpedemonte
Comment 30•20 years ago
|
||
*** Bug 275563 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 31•20 years ago
|
||
Comment on attachment 168781 [details] [diff] [review]
patch for 10.1 and 10.2+
peterv, are you an sr?
Attachment #168781 -
Flags: superreview?(peterv)
Blocks: 276367
(In reply to comment #29)
> We really need to clean up this and similar bits [e.g. bug 266551] when we drop
> support for 10.1.
I filed bug 276367 to track 10.1 dropping work.
No longer blocks: 276367
Comment 33•20 years ago
|
||
Comment on attachment 168781 [details] [diff] [review]
patch for 10.1 and 10.2+
>Index: nsATSUIUtils.cpp
>===================================================================
>+ // We dynamically load the function and only use if available (OS 10.2+)
Drop the 'OS' or make it 'OS X' ;-).
>+ fpMeasureText = (fpMeasureText_type)
>+ ::CFBundleGetFunctionPointerForName(bundle,
>+ CFSTR("ATSUGetUnjustifiedBounds"));
Long line, move this left two spaces.
>+ // If the function is not found (which would happen on OS 10.1), then
Drop the 'OS' or make it 'OS X'.
>+ fpMeasureText = (fpMeasureText_type)
>+ ::CFBundleGetFunctionPointerForName(bundle,
>+ CFSTR("ATSUMeasureText"));
Long line. Move this left like above.
>Index: nsATSUIUtils.h
>===================================================================
>+// ATSUMeasureText and ATSUGetUnjustifiedBounds share the same signature.
>+typedef OSStatus (*fpMeasureText_type) (ATSUTextLayout, UniCharArrayOffset,
>+ UniCharCount, ATSUTextMeasurement*,
>+ ATSUTextMeasurement*, ATSUTextMeasurement*,
Long line, rewrap.
Attachment #168781 -
Flags: superreview?(peterv) → superreview+
Assignee | ||
Comment 34•20 years ago
|
||
Committed to trunk. ->FIXED
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•