/*
* String folding
*
* Copyright 2003 Jon Griffiths
*
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
/*
* Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
* other than GPL or LGPL is available it will apply instead, Oracle elects to use only
* the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
* a choice of LGPL license versions is made available with the language indicating
* that LGPLv2 or any later version may be used, or where a choice of which version
* of the LGPL is applied is otherwise unspecified.
*/
{
extern const WCHAR wine_digitmap[];
}
{
extern const WCHAR wine_compatmap[];
}
{
0x00c6, 0x00de, 0x00df, 0x00e6, 0x00fe, 0x0132, 0x0133, 0x0152,
0x0153, 0x01c4, 0x01c5, 0x01c6, 0x01c7, 0x01c8, 0x01c9, 0x01ca,
0x01cb, 0x01cc, 0x01e2, 0x01e3, 0x01f1, 0x01f2, 0x01f3, 0x01fc,
0x01fd, 0x05f0, 0x05f1, 0x05f2, 0xfb00, 0xfb01, 0xfb02, 0xfb03,
0xfb04, 0xfb05, 0xfb06
};
/* Unicode expanded ligatures */
{
{ 'A','E','\0',1 },
{ 'T','H','\0',1 },
{ 's','s','\0',1 },
{ 'a','e','\0',1 },
{ 't','h','\0',1 },
{ 'I','J','\0',1 },
{ 'i','j','\0',1 },
{ 'O','E','\0',1 },
{ 'o','e','\0',1 },
{ 'D',0x017d,'\0',1 },
{ 'D',0x017e,'\0',1 },
{ 'd',0x017e,'\0',1 },
{ 'L','J','\0',1 },
{ 'L','j','\0',1 },
{ 'l','j','\0',1 },
{ 'N','J','\0',1 },
{ 'N','j','\0',1 },
{ 'n','j','\0',1 },
{ 0x0100,0x0112,'\0',1 },
{ 0x0101,0x0113,'\0',1 },
{ 'D','Z','\0',1 },
{ 'D','z','\0',1 },
{ 'd','z','\0',1 },
{ 0x00c1,0x00c9,'\0',1 },
{ 0x00e1,0x00e9,'\0',1 },
{ 0x05d5,0x05d5,'\0',1 },
{ 0x05d5,0x05d9,'\0',1 },
{ 0x05d9,0x05d9,'\0',1 },
{ 'f','f','\0',1 },
{ 'f','i','\0',1 },
{ 'f','l','\0',1 },
{ 'f','f','i',2 },
{ 'f','f','l',2 },
{ 0x017f,'t','\0',1 },
{ 's','t','\0',1 }
};
{
{
else
}
return 0;
}
{
{
else
return wine_expanded_ligatures[pos];
}
return empty_ligature;
}
/* fold a unicode string */
{
int i;
if (srclen == -1)
if (!dstlen)
{
/* Calculate the required size for dst */
if (flags & MAP_EXPAND_LIGATURES)
{
while (srclen--)
{
src++;
}
}
else if (flags & MAP_COMPOSITE)
{
/* FIXME */
}
else if (flags & MAP_PRECOMPOSED)
{
/* FIXME */
}
return dstlen;
}
return 0;
/* Actually perform the mapping(s) specified */
for (i = 0; i < srclen; i++)
{
if (flags & MAP_EXPAND_LIGATURES)
{
if (expand[0])
{
if (!dstlen--)
return 0;
if (expand[2])
{
if (!dstlen--)
return 0;
}
else
dst++;
}
}
else if (flags & MAP_COMPOSITE)
{
/* FIXME */
}
else if (flags & MAP_PRECOMPOSED)
{
/* FIXME */
}
if (flags & MAP_FOLDDIGITS)
if (flags & MAP_FOLDCZONE)
src++;
}
}