


javascript - How to generate stroked fonts and save them as pictures, using canvas or php?
The size of the stroke can be set
At present, the QR code is automatically generated in the background, and the text is also automatically generated. I have integrated it in the center of the picture using css
<code>代码结构如下: <link href="print.css" rel="stylesheet" media="print"> <div> <img src="" /> <span class="font-border">我是描边字体</span> </div> </code>
The style of print.css is as follows:
<code>.font-border{ text-shadow: 0 0 6px #fff,0 0 6px #fff,0 0 6px #fff,0 0 6px #fff,0 0 6px #fff,0 0 6px #fff,0 0 6px #fff,0 0 6px #fff,0 0 6px #fff,0 0 6px #fff,0 0 6px #fff,0 0 6px #fff,0 0 6px #fff,0 0 6px #fff; } </code>
The final style also has a stroke effect, but after clicking print, the stroke style disappears (Google Chrome version 52.0.2743.60 (64-bit))
Is it that printing does not support text-shadow?
2. Later I found http://www.liantu.com/ and found that they use canvas to integrate pictures and text.
But they encrypted it, and after decrypting it, it couldn’t be read. The variables were all single letters.
Can I use canvas to directly wrap the pictures and text elements I set above and their positions? Then I clicked download and downloaded the pictures directly to the local
3. Or is there any php plug-in that can be used to achieve strokes?
Reply content:
The size of the stroke can be set
At present, the QR code is automatically generated in the background, and the text is also automatically generated. I have integrated it in the center of the picture using css
<code>代码结构如下: <link href="print.css" rel="stylesheet" media="print"> <div> <img src="" /> <span class="font-border">我是描边字体</span> </div> </code>
The style of print.css is as follows:
<code>.font-border{ text-shadow: 0 0 6px #fff,0 0 6px #fff,0 0 6px #fff,0 0 6px #fff,0 0 6px #fff,0 0 6px #fff,0 0 6px #fff,0 0 6px #fff,0 0 6px #fff,0 0 6px #fff,0 0 6px #fff,0 0 6px #fff,0 0 6px #fff,0 0 6px #fff; } </code>
The final style also has a stroke effect, but after clicking print, the stroke style disappears (Google Chrome version 52.0.2743.60 (64-bit))
Is it that printing does not support text-shadow?
2. Later I found http://www.liantu.com/ and found that they use canvas to integrate pictures and text.
But they encrypted it, and after decrypting it, it couldn’t be read. The variables were all single letters.
Can I use canvas to directly wrap the pictures and text elements I set above and their positions? Then I clicked download and downloaded the pictures directly to the local
3. Or is there any php plug-in that can be used to achieve strokes?
Draw pictures onto canvas
, and the same goes for text. canvas
supports text strokes.
Example:
https://jsfiddle.net/imys/yjhs8rz4/
php to generate font images, stroke fonts are related to font files

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



There are two ways to create a Bootstrap split line: using the tag, which creates a horizontal split line. Use the CSS border property to create custom style split lines.

There are several ways to insert images in Bootstrap: insert images directly, using the HTML img tag. With the Bootstrap image component, you can provide responsive images and more styles. Set the image size, use the img-fluid class to make the image adaptable. Set the border, using the img-bordered class. Set the rounded corners and use the img-rounded class. Set the shadow, use the shadow class. Resize and position the image, using CSS style. Using the background image, use the background-image CSS property.

To adjust the size of elements in Bootstrap, you can use the dimension class, which includes: adjusting width: .col-, .w-, .mw-adjust height: .h-, .min-h-, .max-h-

HTML defines the web structure, CSS is responsible for style and layout, and JavaScript gives dynamic interaction. The three perform their duties in web development and jointly build a colorful website.

To set up the Bootstrap framework, you need to follow these steps: 1. Reference the Bootstrap file via CDN; 2. Download and host the file on your own server; 3. Include the Bootstrap file in HTML; 4. Compile Sass/Less as needed; 5. Import a custom file (optional). Once setup is complete, you can use Bootstrap's grid systems, components, and styles to create responsive websites and applications.

In PHP, the final keyword is used to prevent classes from being inherited and methods being overwritten. 1) When marking the class as final, the class cannot be inherited. 2) When marking the method as final, the method cannot be rewritten by the subclass. Using final keywords ensures the stability and security of your code.

How to use the Bootstrap button? Introduce Bootstrap CSS to create button elements and add Bootstrap button class to add button text

Answer: You can use the date picker component of Bootstrap to view dates in the page. Steps: Introduce the Bootstrap framework. Create a date selector input box in HTML. Bootstrap will automatically add styles to the selector. Use JavaScript to get the selected date.
