Skip to content

Indic Script labels not rendered correctly #8765

Open
@aquiire

Description

@aquiire

Bug report

Bug summary

Title sums it up all I guess.
Related:

Here I used sinhala as Indic Script instance.
I think the font family has to do something with this issue since output to different font families are different. I'm not an expert in these stuff. Help appreciated to to get this work even with a different font family.
An example is given below for which I've tried with 3 different font families.
Code for reproduction

from matplotlib import rc
families = ['WARNA','LKLUG','Arial']
for familyname in families:
    rc('font', family=familyname)
    from matplotlib import pyplot as plt
    import numpy as np
    r = np.linspace(0.1,5,100)
    A = 3*2/(r*2)+np.pi*r**2
    fig = plt.figure()
    axes = fig.add_axes([.1,.1,.8,.8]) 
    axes.plot(r,A)
    axes.set_ylabel(u'වර්ගඵලය')
    axes.set_xlabel(u'අරය')
    axes.set_title(familyname)

Actual outcome

Result 1
Result 2
Result 3

Expected outcome

Result 1 looks fine but it has 2 problems:

  • Accents not been placed in the correct location. ("්" in "වර්ගඵලය" is placed after "ර" not before)
  • Letter "A" is not renderd in the title "WARNA"

Issues in result 2:

  • Same previous accent issue
  • Axis values or title not shown at all

Issues in result 3:

  • No Sinhala script shown.

Versions

Software Version
Python 2.7.13 64bit [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)]
IPython 5.1.0
OS Linux 4.4.0 78 generic x86_64 with debian jessie sid
matplotlib 1.5.1

(Matplotlib from anaconda bundle)

Wed Jun 14 22:54:11 2017 +0530

Metadata

Metadata

Assignees

Type

No type

Projects

Status

In Progress

Relationships

None yet

Development

No branches or pull requests

Issue actions