FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Indic Script labels not rendered correctly · Issue #8765 · matplotlib/matplotlib · GitHub

Repository navigation

Indic Script labels not rendered correctly #8765

Closed

Description

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



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

Activity

  1. added this to the milestone on Jun 15, 2017
  2. anntzer commented on Jun 23, 2017

    Contributor

    The misplaced accent is due to lack of support for combining characters at the freetype level (e.g. https://stackoverflow.com/questions/9985340/how-to-render-combined-unicode-characters-in-freetype). Using a real text layout engine (MEP14) is probably not going to happen any time soon :-/

    Not sure what's happening with the missing A (well I guess the glyph is missing? unlikely though) and the missing title of case 2.

    Case 3 is just that Arial does not provide Indic characters (in all likelihood) so you're out of luck.

  3. modified the milestones: , on Jun 25, 2017
  4. anntzer commented on Nov 4, 2017

    Contributor

    /self-promotion/ mplcairo now supports complex text layout using libraqm, this was suprisingly easy to add...

  5. modified the milestones: , on Jan 14, 2018
  6. baabsa commented on Feb 24, 2018

    can you please illustrate steps for adding and use (libraqm),

    I am new in python and I didn't find an easy explanation how it is used.

    Thanks in advance.

  7. anntzer commented on Feb 24, 2018

    Contributor

    It is a fairly technical project and will probably not be implemented any time soon.
    But most solutions that fixes indic script will likewise fix arabic script (*well technically you can have a shaper without RTL support but let's not get there).

  8. baabsa commented on Feb 24, 2018

    this issue doesn't appear in printing an Arabic word from DataFrame, it is only appear when I have Arabic words in plot as x axes, y axes, or title!

  9. modified the milestones: , on Feb 27, 2018
  10. 1 remaining item

  11. anntzer commented on Jul 5, 2019

    Contributor

    Actually this issue is basically already tracked at #5941, so I'll close this one as a duplicate.

  12. self-assigned this
    on Jun 5, 2025
  13. QuLogic commented on Jun 5, 2025

    Member

    Not sure why this is a duplicate of #5941, but that's closed and this issue isn't actually fixed.

  14. reopened this on Jun 5, 2025
  15. moved this from Waiting for other PR to In Progress in Font and text overhaulon Jun 5, 2025
  16. added this to the v3.11.0 milestone on Jun 5, 2025
  17. linked a pull request that will close this issueImplement text shaping with libraqm #30000on Aug 8, 2025
  18. QuLogic commented on Apr 10, 2026

    Member

    The text-overhaul branch is now merged to main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


Back | FazBrowse Home | New Git URL