Closed Bug 36863 Opened 25 years ago Closed 24 years ago

CSS: small-caps/uppercase: ?ß should become SS

Categories

(Core :: Internationalization, defect, P3)

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: burnus, Assigned: shanjian)

References

()

Details

(Keywords: helpwanted)

Attachments

(1 file)

Hi, this is with the M16 snapshoot from 2000-04-21-13. font-variant:small-caps: the `ß' ß should IMO converted to `SS' when used with small-caps or when converted to uppercase (text-transform:uppercase). This is at least convention in German (and as far as I know, the SS lignature (wrongly called SZ lignature, but who cares) is only used in German). Tobias This war previously included in Bug #36827
Confirming...
Severity: normal → minor
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Linux → All
Hardware: PC → All
Reassigned to ftang who is the last one to have touched csCRT::ToUpper().
Assignee: pierre → ftang
Component: Style System → Internationalization
This require special casing handling.
Status: NEW → ASSIGNED
Target Milestone: --- → M18
related to 16796 Here is my change to nsICaseConversion.h so we now have a new set of method which can handle the case the input string have different length of the output string. I need pierre/troy's help to integrate into nsTextTransformer and nsTextFrame I will check in the following code soon. Index: unicharutil//public/nsICaseConversion.h =================================================================== RCS file: /m/pub/mozilla/intl/unicharutil/public/nsICaseConversion.h,v retrieving revision 1.4 diff -u -r1.4 nsICaseConversion.h --- nsICaseConversion.h 1999/11/06 03:26:12 1.4 +++ nsICaseConversion.h 2000/04/25 21:31:41 @@ -25,6 +25,7 @@ #include "nsISupports.h" #include "nscore.h" +#include "nsString.h" // {07D3D8E0-9614-11d2-B3AD-00805F8A6670} #define NS_ICASECONVERSION_IID \ @@ -55,6 +56,11 @@ // Convert an array of Unicode characters into title case NS_IMETHOD ToTitle( const PRUnichar* anArray, PRUnichar* aReturn, PRUint32 aLen, PRBool aStartInWordBundary=PR_TRUE) = 0; + + // The following nsString flavor one know how to handle special casing + NS_IMETHOD ToUpper(const PRUnichar* anIn, PRUint32 aLen, nsString& anOut, const PRUnichar* aLocale=nsnull) = 0; + NS_IMETHOD ToLower(const PRUnichar* anIn, PRUint32 aLen, nsString& anOut, const PRUnichar* aLocale=nsnull ) = 0; + NS_IMETHOD ToTitle(const PRUnichar* anIn, PRUint32 aLen, nsString& anOut, const PRUnichar* aLocale=nsnull, PRBool aStartInWordBoundary=PR_TRUE) = 0; }; Index: unicharutil//src/nsCaseConversionImp2.cpp =================================================================== RCS file: /m/pub/mozilla/intl/unicharutil/src/nsCaseConversionImp2.cpp,v retrieving revision 1.13 diff -u -r1.13 nsCaseConversionImp2.cpp --- nsCaseConversionImp2.cpp 2000/04/05 00:10:08 1.13 +++ nsCaseConversionImp2.cpp 2000/04/25 21:31:41 @@ -333,6 +333,96 @@ return NS_OK; } +#define k_ss 0x00df +#define kDot_I 0x0130 +#define kDot_i PRUnichar('i') +#define kDotLess_I PRUnichar('I') +#define kDotLess_i 0x0131 + +NS_IMETHODIMP nsCaseConversionImp2::ToUpper + (const PRUnichar* anIn, PRUint32 aLen, nsString& anOut, const PRUnichar* aLocale) +{ + anOut.SetString(anIn,aLen); + + // Special casing - Turkish dotless I + if((nsnull != aLocale ) && (PRUnichar('t')==aLocale[0]) && (PRUnichar('r') == aLocale[1])) + { + for(PRUnichar* s=(PRUnichar*)anOut.GetUnicode(); *s ; s++) + { + if(kDot_i == *s) + *s = kDot_I; + } + } + + ToUpper(anOut.GetUnicode(), (PRUnichar*)anOut.GetUnicode(), anOut.Length()); + + // Special casing - SS + PRInt32 idx=0; + for(PRUnichar* s=(PRUnichar*)anOut.GetUnicode(); *s ; s++,idx++) + { + if(k_ss == *s) { + *s = PRUnichar('S') ; + anOut.Insert(PRUnichar('S'),idx); + // Insert may cause reallocate, so we need to GetUnicode() again + s = (PRUnichar*)anOut.GetUnicode() + idx; + idx++; + } + } + return NS_OK; +} +NS_IMETHODIMP nsCaseConversionImp2::ToLower + (const PRUnichar* anIn, PRUint32 aLen, nsString& anOut, const PRUnichar* aLocale) +{ + anOut.SetString(anIn,aLen); + + // Special casing - Turkish dotless I + if((nsnull != aLocale ) && (PRUnichar('t')==aLocale[0]) && (PRUnichar('r') == aLocale[1])) + { + for(PRUnichar* s=(PRUnichar*)anOut.GetUnicode(); *s ; s++) + { + if(kDot_I == *s) + *s = kDot_I; + } + } + + ToLower(anOut.GetUnicode(), (PRUnichar*)anOut.GetUnicode(), anOut.Length()); + + return NS_OK; +} +NS_IMETHODIMP nsCaseConversionImp2::ToTitle + (const PRUnichar* anIn, PRUint32 aLen, nsString& anOut, const PRUnichar* aLocale, + PRBool aStartInWordBoundary) +{ + anOut.SetString(anIn,aLen); + + // Special casing - Turkish dotless I + if((nsnull != aLocale ) && (PRUnichar('t')==aLocale[0]) && (PRUnichar('r') == aLocale[1])) + { + for(PRUnichar* s=(PRUnichar*)anOut.GetUnicode(); *s ; s++) + { + if(kDot_i == *s) + *s = kDot_I; + } + } + + ToTitle(anOut.GetUnicode(), (PRUnichar*)anOut.GetUnicode(), anOut.Length(), + aStartInWordBoundary); + + // Special casing - SS + PRInt32 idx=0; + for(PRUnichar* s=(PRUnichar*)anOut.GetUnicode(); *s ; s++,idx++) + { + if(k_ss == *s) { + *s = PRUnichar('S') ; + anOut.Insert(PRUnichar('S'),idx); + // Insert may cause reallocate, so we need to GetUnicode() again + s = (PRUnichar*)anOut.GetUnicode() + idx; + idx++; + } + } + return NS_OK; +} + nsCaseConversionImp2::nsCaseConversionImp2() Index: unicharutil//src/nsCaseConversionImp2.h =================================================================== RCS file: /m/pub/mozilla/intl/unicharutil/src/nsCaseConversionImp2.h,v retrieving revision 1.7 diff -u -r1.7 nsCaseConversionImp2.h --- nsCaseConversionImp2.h 1999/11/06 03:26:15 1.7 +++ nsCaseConversionImp2.h 2000/04/25 21:31:41 @@ -51,6 +51,9 @@ NS_IMETHOD ToTitle(const PRUnichar* anArray, PRUnichar* aReturn, PRUint32 aLen, PRBool aStartInWordBoundary = PR_TRUE); + NS_IMETHOD ToUpper(const PRUnichar* anIn, PRUint32 aLen, nsString& anOut, const PRUnichar* aLocale=nsnull) ; + NS_IMETHOD ToLower(const PRUnichar* anIn, PRUint32 aLen, nsString& anOut, const PRUnichar* aLocale=nsnull ); + NS_IMETHOD ToTitle(const PRUnichar* anIn, PRUint32 aLen, nsString& anOut, const PRUnichar* aLocale=nsnull, PRBool aStartInWordBoundary=PR_TRUE) ; private: static nsrefcnt gInit; };
troy, I will come to your office and discuss w/ you about the current nsTextTransformer code. I am not sure what is the best way to integrate the new method call.
changing the case coversion code in the intl/unicharutil won't help. Currently, the code in nsTextFrame.cpp call the character based (not string based) ToUpper from nsCRT. I try to fix the nsTextFrame.cpp but it is very hard because we need to expand the buffer and also the position need to align with the space buffer. (search ToUpper in nsTextFrame.cpp to locate the code, there are two, the measure width one is easier to fix. but the draw string one is very hard without hurting the performance.)
Keywords: helpwanted
add elisa@netobjects.com to cc list.
add test cases into test0.html but hide in comment. The uppercase part is fixed in bug 16796. limit the scope of this bug to the small-caps for easier bug tracking.
case conversion issue. Reassign to nhotta and cc erik. It is easier to fix this problem in the nsTextFrame.cpp code to deal with this special case. I have fix it for text-transform: uppercase in nsTextTransformer.cpp This is really layout issue.
Assignee: ftang → nhotta
Status: ASSIGNED → NEW
Status: NEW → ASSIGNED
QA Contact: chrisd → teruko
Target Milestone: M18 → M28
reassign to erik
Assignee: nhotta → erik
Status: ASSIGNED → NEW
want to fix this?
Assignee: erik → shanjian
Changed QA contact to andreasb@netscape.com for now.
QA Contact: teruko → andreasb
Attached patch proposed patchSplinter Review
Status: NEW → ASSIGNED
erik, need your sr=
Shanjian, I see some code for CSS's "small-caps", but what about "text-transform: uppercase"?
Frank mentioned thad transform:uppercase has been fixed.
r=erik
fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Summary: CSS: small-caps/uppercase: ß should become SS → CSS: small-caps/uppercase: Žß should become SS
verified fixed using the following builds: Win98 2001032204 Mac 2001032608 Linux 2001032608
Status: RESOLVED → VERIFIED
Summary: CSS: small-caps/uppercase: Žß should become SS → CSS: small-caps/uppercase: ?ß should become SS
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: