0

我正在使用 Smarty 构建带有拉引号的文章布局,使用 webfonts 进行样式设置。我想为电子邮件客户端创建一个并行布局,其中自动包含一个 png 版本的拉引号。

有没有办法根据我用来格式化文章布局的拉引号的代码片段将 png 图像写入文件,就像我可以从 Smarty 模板编写 html 文件一样?

这是我的代码段:

<p class="quote" style="width:720px; color: #ff0066;font-family: {$quotes.0.fontfamily};font-size: {$quotes.0.size}px;text-indent: -12px; margin: 0 20px 0.5em 20px;">{$quotes.0.quote}</p>

这就是我想象的输出可能起作用的方式:

// get output 
$output = $smarty->fetch('quote-image.tpl'); 
// write png image file
$file = $quotes["filename"].'.png';
file_put_contents($file,$output); 

但显然事情没那么简单!

4

0 回答 0