pyvista / pyvista

3D plotting and mesh analysis through a streamlined interface for the Visualization Toolkit (VTK)
https://docs.pyvista.org
MIT License
2.74k stars 504 forks source link

arial font is not arial #6705

Open chapochn opened 1 month ago

chapochn commented 1 month ago

Describe the bug, what's wrong, and what you expected.

When I put the labels, with the font 'arial', the font that shows up is not arial! Also looking through the documentation, it is not arial: https://docs.pyvista.org/user-guide/

Steps to reproduce the bug.

import pyvista as pv
import numpy as np
import matplotlib.pyplot as plt

pl = pv.Plotter()

n = 10
points = np.zeros((n, 3))
points[:, 0] = -np.arange(n)

pl = pv.Plotter()
labels = [str(i) for i in range(n)]
pl.add_point_labels(points ,labels, point_color='k', point_size=30, always_visible=True, font_family='arial')

pl.render()
pl.show()

System Information

--------------------------------------------------------------------------------
  Date: Wed Oct 16 16:24:32 2024 EDT

                OS : Darwin (macOS 14.6.1)
            CPU(s) : 12
           Machine : arm64
      Architecture : 64bit
               RAM : 32.0 GiB
       Environment : Jupyter
       File system : apfs
        GPU Vendor : Apple
      GPU Renderer : Apple M2 Pro
       GPU Version : 4.1 Metal - 88.1
  MathText Support : True

  Python 3.12.7 | packaged by conda-forge | (main, Oct  4 2024, 15:57:01)
  [Clang 17.0.6 ]

           pyvista : 0.44.1
               vtk : 9.3.1
             numpy : 1.26.4
        matplotlib : 3.9.2
            scooby : 0.10.0
             pooch : 1.8.2
            pillow : 11.0.0
           imageio : 2.36.0
         pyvistaqt : 0.11.1
             PyQt5 : 5.15.9
           IPython : 8.28.0
        ipywidgets : 8.1.5
             scipy : 1.14.1
              tqdm : 4.66.5
        jupyterlab : 4.2.5
             trame : 3.6.5
      trame_client : 3.3.2
      trame_server : 3.2.3
         trame_vtk : 2.8.10
     trame_vuetify : 2.7.1
      nest_asyncio : 1.6.0
--------------------------------------------------------------------------------

Screenshots

This is the output vs arial

Screenshot 2024-10-16 at 4 16 19 PM Screenshot 2024-10-16 at 4 16 27 PM

chapochn commented 1 month ago

I will create a PR to have font_file as an option for add_point_labels, so that one can have any font