[omaha] Languages, fonts, scripts?

Jeff Hinrichs - DM&T jeffh at dundeemt.com
Tue Nov 4 03:54:26 CET 2014


Not that you should change your solution, but a quesiton.  If you use
css+html, what is displayed in the browser?  And if it is correct, I would
think that reportlab would get it right. In fonts, there is no adding of
fonts, it would have to replace the two glyphs with another from the font's
glyph table.  ??
-j

On Mon, Nov 3, 2014 at 8:22 PM, Steve Young <wereapwhatwesow at gmail.com>
wrote:

> In case anyone needs to deal with this in the future:
>
> Some languages have some advanced scripts - for example Hindi has
> 'dependent vowels':
> In some words, written vowels change their form in order to join up with
> consonants.
>
> - With ‘i’: ि – कि [ki] is a combination of क + इ (k + i). The character ि
> is
> added to the left and above.
>
> There are about a dozen of these rules. When typing the Hindi word किताब
> ('book' in English) you press क then  ि and the result is कि.
>
> Reportlabs does not seem to know the rule, and prints क ि. I have not been
> able to figure exactly why reportlabs fails, so I started trying other
> solutions. (kind of a bummer, because up to that point I liked working with
> it)
>
> On the web, using font-families helps solve the problem of missing glyphs,
> as there can be many fonts in a family. (there are still too many glyphs to
> put all the languages into a single font) and most OS's since around 2006
> recognize most of the world's languages.
>
> I looked at xhtml2pdf but it uses the reportlab toolkit so I thought it
> might have the same problem, and moved on to WeasyPrint.  Like xhtml2pdf It
> uses html and css to format the output, and pycairo to save to a pdf.
> Pycairo seems to convert the text to vector graphics so I don't have to
> worry about embedding fonts. I sent a pdf sample to the printer for
> approval and keeping my fingers crossed.
>
> On Sat, Oct 25, 2014 at 11:46 AM, Jeff Hinrichs - DM&T <jeffh at dundeemt.com
> >
> wrote:
>
> > In general, for the web, you need to always think about graceful
> > degradation.  Our designers, who generally work in print, or like to
> submit
> > a graphic, tend to specify individual fonts, without considering what
> > happens if a specified font is not available to the users browser.
> >
> > http://ffffallback.com/
> > http://blog.typekit.com/2011/03/24/type-study-choosing-fallback-fonts/
> >
> > -j
> >
> > On Sat, Oct 25, 2014 at 9:33 AM, Steve Young <wereapwhatwesow at gmail.com>
> > wrote:
> >
> > > Sorry for the run on thread.
> > >
> > > For example on my site I have:
> > >
> > > font-family: "Lucida Grande", Verdana, Arial, sans-serif;
> > >
> > > and this has so far been able to display all the text properly in its
> > > respective languages.
> > >
> > > On Sat, Oct 25, 2014 at 9:26 AM, Steve Young <
> wereapwhatwesow at gmail.com>
> > > wrote:
> > >
> > > > I just found this https://code.google.com/p/noto/issues/detail?id=13
> ,
> > > > which describes my question exactly. And gives the answer that, no,
> > there
> > > > is not on font to rule them all, and I am going to have to deal with
> > > > multiple fonts creating my PDFs.
> > > >
> > > > But can someone answer how the website manages this?  Does it have
> > > > something to do with specifying font families instead of individual
> > > fonts?
> > > >
> > > > On Sat, Oct 25, 2014 at 9:13 AM, Steve Young <
> > wereapwhatwesow at gmail.com>
> > > > wrote:
> > > >
> > > >> Question about fonts:
> > > >>
> > > >> Still working on a flashcard site with Django 1.7 and python 3.3.
> So
> > > far
> > > >> the website has handled all the text in latin, cyrillic, arabic,
> > hindi,
> > > >> without a hitch.  I copy the text and paste it into the django admin
> > for
> > > >> that field and it just works.
> > > >>
> > > >> I thought this magic was working because of unicode fonts, but while
> > > >> working with reportlab and creating pdfs the magic goes away and I
> > have
> > > to
> > > >> choose fonts that contain the correct characters for the languages.
> > > >>
> > > >> Has anyone worked with languages and can point me in the right
> > direction
> > > >> to learn about this?
> > > >>
> > > >> Thanks.
> > > >>
> > > >
> > > >
> > > _______________________________________________
> > > Omaha Python Users Group mailing list
> > > Omaha at python.org
> > > https://mail.python.org/mailman/listinfo/omaha
> > > http://www.OmahaPython.org
> > >
> >
> >
> >
> > --
> > Best,
> >
> > Jeff Hinrichs
> > 402.218.1473
> > _______________________________________________
> > Omaha Python Users Group mailing list
> > Omaha at python.org
> > https://mail.python.org/mailman/listinfo/omaha
> > http://www.OmahaPython.org
> >
> _______________________________________________
> Omaha Python Users Group mailing list
> Omaha at python.org
> https://mail.python.org/mailman/listinfo/omaha
> http://www.OmahaPython.org
>



-- 
Best,

Jeff Hinrichs
402.218.1473


More information about the Omaha mailing list