I used fontsquirrel to download webfonts but the letter spacing doubles on the iPhone. I tried enabling "remove kerning" in the fontsquirrel settings but that doesn't work.
#font-face {
font-family: 'fjalla_oneregular';
src: url('../../core/texts/fjallaone-regular-webfont.eot');
src: url('../../core/texts/fjallaone-regular-webfont.eot?#iefix') format('embedded-opentype'),
url('../../core/texts/fjallaone-regular-webfont.woff2') format('woff2'),
url('../../core/texts/fjallaone-regular-webfont.woff') format('woff'),
url('../../core/texts/fjallaone-regular-webfont.ttf') format('truetype'),
url('../../core/texts/fjallaone-regular-webfont.svg#fjalla_oneregular') format('svg');
font-weight: normal;
font-style: normal;
-webkit-font-smoothing: antialiased;
}
.post-header h1 {
font-family: "fjalla_oneregular", Impact, Helvetica Neue, Helvetica, sans-serif;
font-weight: 700;
text-transform: uppercase;
color: #191919;
letter-spacing: 0px;
}
Is there a workaround to make the spacing match between desktop browsers and mobile?
That can be a confusing and tough problem to find the solution for. Try moving the SVG URL line before the EOT URL line. It appears that Chrome utilises the .svg file in the #font-face kit, and doesn’t like being called last. Below is the standard call for #font-face using CSS:
#font-face {
font-family: 'chunk-webfont';
src: url('../../includes/fonts/chunk-webfont.eot');
src: url('../../includes/fonts/chunk-webfont.eot?#iefix') format('eot'),
url('../../includes/fonts/chunk-webfont.woff') format('woff'),
url('../../includes/fonts/chunk-webfont.ttf') format('truetype'),
url('../../includes/fonts/chunk-webfont.svg') format('svg');
font-weight: normal;
font-style: normal;
}
As can be seen in the example, the .svg file comes last in the list of called URLs. If we amend the code to target webkit browsers, then tell them to solely utilize the .svg file.
#font-face {
font-family: 'chunk-webfont';
src: url('../../includes/fonts/chunk-webfont.eot');
src: url('../../includes/fonts/chunk-webfont.eot?#iefix') format('eot'),
url('../../includes/fonts/chunk-webfont.woff') format('woff'),
url('../../includes/fonts/chunk-webfont.ttf') format('truetype'),
url('../../includes/fonts/chunk-webfont.svg') format('svg');
font-weight: normal;
font-style: normal;
}
#media screen and (-webkit-min-device-pixel-ratio:0) {
#font-face {font-family: ‘chunk-webfont’;
src: url(‘../../includes/fonts/chunk-webfont.svg’) format(‘svg’);
}
I was using a typeface and the same code from FontSquirrel and recently after the iOS 10 update a few of my sites were all broken with incorrect font spacing.
See Font Face Chrome Rendering for reference
(Big thanks to Sam Goddard for that post!)
Related
Hi everybody I'm developing a CRUD system for a back-end webapp, I've installed tinymce and in the edit page I put the script for it.
<script type="text/javascript">
// Initialize your tinyMCE Editor with your preferred options
tinymce.init({
selector: 'textarea',
height: 200,
theme: 'modern',
plugins: 'print preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists textcolor wordcount imagetools contextmenu colorpicker textpattern help',
toolbar1: 'formatselect | bold underline italic strikethrough | backcolor forecolor | fontselect | fontsizeselect | alignleft aligncenter alignright alignjustify | table ',
toolbar2: 'numlist bullist | outdent indent | removeformat | subscript superscript | link unlink',
fontsize_formats: '7px 8px 9px 10px 11px 12px 13px 14px 15px 16px 17px 18px 19px 20px 21px 22px 23px 24px 25px 26px 27px 28px 29px 30px',
image_advtab: true
});
</script>
The problem is in the table plug-in, when I select cellspace and cellpadding from the editor it works, and seems save it correctly, but when I go in the view page of that element the table don't have that attributes. when I go in the developer tools in chrome I see:
th, td {
padding: 0
}
And if I disable that the table goes in the right dimension...
Anyone can tell me what is the problem??
If it looks correct in TinyMCE but not when rendered outside the editor its likely the CSS of your page is causing that change. This appears to be the case based on what you state about the th and td padding in the dev tools.
I'd like to convert this SVG to PDF with the size scaled up to x10 of it's current size without losing the quality of the picture. The PDF should also be in 300 PPI. How can I achieve kind of output?
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="248.1" height="350.7" viewBox="0 0 248.1 350.7" xml:space="preserve">
<desc>Created with Fabric.js 1.7.19</desc>
<defs>
</defs>
<g transform="translate(51.2 34.1) scale(0.1 0.1)">
<image xlink:href="./cat.jpg" x="-512" y="-341" style="stroke: none; stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1;" width="1024" height="682" preserveAspectRatio="none"></image>
</g>
</svg>
This SVG came from fabricjs toSVG() code. I can resize it using fabricjs, but I'd like to know is it possible to do this and how using ImageMagick.
ImageMagick is a programm suite aimed at raster images. What you have is a format that mixes vector and raster content both for input and output.
ImageMagick can handle that, but only through additional programs that need to be installed:
import from SVG with Inkscape or librsvg
export to PDF with ghostscript
You can cutout the middleman. Inkscape, while being mainly a SVG editor GUI, also has a commandline mode, for example for export tasks. You can scale the SVG by multiplying the height and width values on the root element with your scale - do not change the viewBox attribute:
<svg width="2481" height="3507" viewBox="0 0 248.1 350.7" ...>
Or, if you know the target size of the pages you want, you can set them. Even if aspect ratio does not fit, your content will sized-to-fit on the page. For example with a A4 page:
<svg width="210mm" height="297mm" viewBox="0 0 248.1 350.7" ...>
Then execute Inkscape:
inkscape --without-gui --export-pdf=out.pdf in.svg
Pictures are embeded as-is, so you do not loose resolution.
I using Helvetica Neue LT Std font in my iOS app. When i add a UIButton with Helvetica Neue LT Std (67 Medium Condensed). It cut a bit in top of words. Like this:
You can see it loss a bit at "S" and "G".
Have a try button.titleLabel?.adjustsFontSizeToFitWidth = true?
I'm trying to set a font programmatically. I want to use System Semibold like I'm using in the interface builder. Been looking for it on the list of fonts. Do I need to use
[myButton.titleLabel setFont:[UIFont fontWithName:#"Helvetica-Semibold" size:13.0]]
?
The system font for iOS, starting in iOS 9, is "San Fransisco." To get a semibold version, you could use something along the lines of:
Swift 2.2:
UIFont.systemFontOfSize(20, weight: UIFontWeightSemibold)
Swift 3.0:
UIFont.systemFont(ofSize: 20, weight: UIFontWeightSemibold)
Swift 4.0:
UIFont.systemFont(ofSize: 20, weight: .semibold)
For more information on this, see the UIFont Class Reference.
To further assist you these are the official names of all the helvetica fonts that apple currently supports as taken directly from the Apple website:
https://support.apple.com/en-us/HT202771
Helvetica
Helvetica Bold
Helvetica Bold Oblique
Helvetica Light
Helvetica Light Oblique
Helvetica Neue
Helvetica Neue Bold
Helvetica Neue Bold Italic
Helvetica Neue Condensed Black
Helvetica Neue Condensed Bold
Helvetica Neue Italic
Helvetica Neue Light
Helvetica Neue Light Italic
Helvetica Neue Medium
Helvetica Neue Medium Italic
Helvetica Neue Thin
Helvetica Neue Thin Italic
Helvetica Neue UltraLight
Helvetica Neue UltraLight Italic
Helvetica Oblique
I use all of these:
1. body{ background-image: url('example.png') background-repeat: repeat;
2. body{ background-image: url('assets/example.png') background-repeat: repeat;
3. body{ background-image: url(<%= asset_path 'example.png') background-repeat: repeat;
4. body{ background-image: image-url(<%= asset_path 'example.png' %>) background-repeat: repeat;
5. body{ background-image: image-url('example.png') background-repeat:repeat;
6. body{ background-image: image-url('assets/example.png') background-repeat:repeat;
run assets:precompile
not working all, how to solve this problem, why not working?
Number 5 is closest to the correct syntax. Is it because you're not terminating your first CSS rule with a semi-colon?
body{
background-image: image-url('example.png');
background-repeat:repeat;
}
That should work - note the semi-colon at the end of the background-image line.
Alternatively, merge them into a single rule:
body{
background: image-url('example.png') repeat;
}