Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding drop shadows to fonts? #309

Open
wanderling opened this issue Aug 23, 2023 · 3 comments
Open

Adding drop shadows to fonts? #309

wanderling opened this issue Aug 23, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@wanderling
Copy link

Is your feature request related to a problem? If so, please describe the problem.
A description of what the problem is. E.g. I cannot display this data the way I want [...]

Text is hard to read on pattered backgrounds.

Describe the feature / solution to your problem you'd like
A description of what you want to happen.

Adding drop shadows or support for chromatic fonts would be a great help.

Describe alternatives you've considered / and or tested
A description of any alternative solutions or features you've considered.

Screenshots / photos & mockups of the Turing screen
Add screenshots or photos/mockups of the rendering on the Turing screen to help explain your request.
You can drag and drop photos here to add them to the description.

Environment:

  • Revision of this project [e.g. 1.1.1, main branch, specific commit]
    3.1.0
  • OS with version [e.g. Windows 11, Ubuntu 22.04]
    Linux Mint 21.2 Victoria
  • Python version [e.g. Python 3.8]
    Python 3.10.12
  • Hardware [e.g. Intel CPU, Nvidia GPU, Raspberry Pi 3 B+ ...]
    OptiPlex 3020M

Additional context
Add any other context or screenshots about the feature request here.

@wanderling wanderling added the enhancement New feature or request label Aug 23, 2023
@ghost
Copy link

ghost commented Sep 22, 2023

This might be doable by overlaying text twice with different colors and slightly offset from each other. This trick can be used to cause text to appear sunken or raised up depending on the colors used.

@mathoudebine
Copy link
Owner

You're right, something like this could be used: https://stackoverflow.com/questions/67473444/how-to-make-text-shadow-effect-in-pillow-python
Unfortunately there is no native function to add shadows to PIL texts

@mathoudebine
Copy link
Owner

Also relevant: draw the text multiple times with 1-pixel offsets: https://itecnote.com/tecnote/python-text-shadow-with-python/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants