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

box-shadow and text-shadow support #149

Closed
wants to merge 16 commits into
base: master
from

Conversation

Projects
None yet
4 participants
@liZe
Member

liZe commented Dec 27, 2013

Fix #13.

@Le-Stagiaire

This comment has been minimized.

Show comment
Hide comment
@Le-Stagiaire

Le-Stagiaire Dec 31, 2013

Member

Awesome work !

Member

Le-Stagiaire commented Dec 31, 2013

Awesome work !

@aaronpeterson

This comment has been minimized.

Show comment
Hide comment
@aaronpeterson

aaronpeterson Oct 1, 2014

Can this still be merged?

aaronpeterson commented Oct 1, 2014

Can this still be merged?

@liZe

This comment has been minimized.

Show comment
Hide comment
@liZe

liZe Oct 2, 2014

Member

It works quite well and probably can be merged. The main problem is that the changes rely on PIL/pillow. @SimonSapin what do you think about that?

Member

liZe commented Oct 2, 2014

It works quite well and probably can be merged. The main problem is that the changes rely on PIL/pillow. @SimonSapin what do you think about that?

@SimonSapin

This comment has been minimized.

Show comment
Hide comment
@SimonSapin

SimonSapin Oct 2, 2014

Member

Requiring PIL makes me very sad, but I don’t have an alternative to propose right now.

Member

SimonSapin commented Oct 2, 2014

Requiring PIL makes me very sad, but I don’t have an alternative to propose right now.

@liZe

This comment has been minimized.

Show comment
Hide comment
@liZe

liZe Oct 2, 2014

Member

Of course, another big problem of this implementation is that it relies on bitmaps for the shadows, even in PDFs. But as Simon, this bad solution is the best solution I can think of.

The real solution is to have this in cairo, but that will probably never happen.
http://lists.freedesktop.org/archives/cairo/2012-June/023287.html

IMO, we can merge this PR because the added code is small, simple, and doesn't change anything in the architecture. We must open another bug to remember that pixmaps in PDFs are bad and that this implementation is slooooow as hell.

Oh, and I'd really like someone to remove this awful 4/3 ratio before merging.

Member

liZe commented Oct 2, 2014

Of course, another big problem of this implementation is that it relies on bitmaps for the shadows, even in PDFs. But as Simon, this bad solution is the best solution I can think of.

The real solution is to have this in cairo, but that will probably never happen.
http://lists.freedesktop.org/archives/cairo/2012-June/023287.html

IMO, we can merge this PR because the added code is small, simple, and doesn't change anything in the architecture. We must open another bug to remember that pixmaps in PDFs are bad and that this implementation is slooooow as hell.

Oh, and I'd really like someone to remove this awful 4/3 ratio before merging.

thickness, enable_hinting)
for x, y, blur, color in reversed(textbox.style.text_shadow):
# TODO: fix this 4/3 ratio

This comment has been minimized.

@liZe

liZe Oct 2, 2014

Member

Please, fix me before merging!

@liZe

liZe Oct 2, 2014

Member

Please, fix me before merging!

@liZe

This comment has been minimized.

Show comment
Hide comment
@liZe

liZe Jul 28, 2016

Member

I close this PR as it won't be merged. Depending on the PIL and using raster blurs are an awful solution.

Member

liZe commented Jul 28, 2016

I close this PR as it won't be merged. Depending on the PIL and using raster blurs are an awful solution.

@liZe liZe closed this Jul 28, 2016

quis added a commit to alphagov/notifications-utils that referenced this pull request Dec 9, 2016

Add styling for placeholders in letter templates
This commit highlights placeholders in letter previews the same way
that we do for emails and text messages. The implementation is slightly
different because WeasyPrint doesn’t support box-shadow (see
Kozea/WeasyPrint#149 (comment) for
reasons).

Luckily WeasyPrint _does_ support CSS3 multiple backgrounds, so we can
mask the curved edges with SVG background images instead. This wouldn’t
be a great solution on the web because it you might get a flash of
unstyled placeholder as the images loaded. But because the PDF is
rendered completely before it’s served it shouldn’t be a problem.

@quis quis referenced this pull request Dec 9, 2016

Merged

Make letter previews reflect what the letter will look like #100

1 of 1 task complete

quis added a commit to alphagov/notifications-utils that referenced this pull request Dec 13, 2016

Add styling for placeholders in letter templates
This commit highlights placeholders in letter previews the same way
that we do for emails and text messages. The implementation is slightly
different because WeasyPrint doesn’t support box-shadow (see
Kozea/WeasyPrint#149 (comment) for
reasons).

Luckily WeasyPrint _does_ support CSS3 multiple backgrounds, so we can
mask the curved edges with SVG background images instead. This wouldn’t
be a great solution on the web because it you might get a flash of
unstyled placeholder as the images loaded. But because the PDF is
rendered completely before it’s served it shouldn’t be a problem.

quis added a commit to alphagov/notifications-utils that referenced this pull request Dec 14, 2016

Add styling for placeholders in letter templates
This commit highlights placeholders in letter previews the same way
that we do for emails and text messages. The implementation is slightly
different because WeasyPrint doesn’t support box-shadow (see
Kozea/WeasyPrint#149 (comment) for
reasons).

Luckily WeasyPrint _does_ support CSS3 multiple backgrounds, so we can
mask the curved edges with SVG background images instead. This wouldn’t
be a great solution on the web because it you might get a flash of
unstyled placeholder as the images loaded. But because the PDF is
rendered completely before it’s served it shouldn’t be a problem.

quis added a commit to alphagov/notifications-utils that referenced this pull request Dec 14, 2016

Add styling for placeholders in letter templates
This commit highlights placeholders in letter previews the same way
that we do for emails and text messages. The implementation is slightly
different because WeasyPrint doesn’t support box-shadow (see
Kozea/WeasyPrint#149 (comment) for
reasons).

Luckily WeasyPrint _does_ support CSS3 multiple backgrounds, so we can
mask the curved edges with SVG background images instead. This wouldn’t
be a great solution on the web because it you might get a flash of
unstyled placeholder as the images loaded. But because the PDF is
rendered completely before it’s served it shouldn’t be a problem.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment