Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@ When running in the CLI, some useful flags include:

Take a look at custom_config.yml for further configuration. To add your customization, you can either edit this file, or add another file by the same name "custom_config.yml" to whatever directory you are running manim from. For example [this is the one](https://github.com/3b1b/videos/blob/master/custom_config.yml) for 3blue1brown videos. There you can specify where videos should be output to, where manim should look for image files and sounds you want to read in, and other defaults regarding style and video quality.

### Troubleshooting
If you experience unexpected behavior with window positioning and/or sizing, consider setting the environment
variable `PYGLET_DPI_SCALING` to either `scaled` or `stretch`. For instance:
```sh
PYGLET_DPI_SCALING=scaled manimgl example_scenes.py OpeningManimExample
```

### Documentation
Documentation is in progress at [3b1b.github.io/manim](https://3b1b.github.io/manim/). And there is also a Chinese version maintained by [**@manim-kindergarten**](https://manim.org.cn): [docs.manim.org.cn](https://docs.manim.org.cn/) (in Chinese).

Expand Down
13 changes: 13 additions & 0 deletions manimlib/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@

T = TypeVar("T")

import os, sys, pyglet

# It should be natively supported by Pyglet, but it doesn't work at the moment.
# See https://github.com/pyglet/pyglet/issues/1342
dpi_scaling = os.environ.get('PYGLET_DPI_SCALING')
if dpi_scaling:
# dpi_scaling introduced in Pyglet 2.1
if hasattr(pyglet.options, 'dpi_scaling'):
pyglet.options.dpi_scaling = dpi_scaling
else:
print("Installed Pyglet doesn't support DPI scaling.",
file=sys.stderr)


class Window(PygletWindow):
fullscreen: bool = False
Expand Down