System Fonts in SVG

There was a time when the smart move in picking fonts for a website was to a font-family that was supported across as many platforms as possible. font-family: Tahoma; and whatnot. Or even better, a font stack that would fall back to as-similar-as possible stuff, like font-family: Tahoma, Verdana, Segoe, sans-serif;.

These days, an astonishing number of sites are using custom fonts. 60%!

No surprise, there is also a decent amount of pushback on custom fonts. They need to be downloaded, thus there are performance/bandwidth hits. There is loads of nuance on how you load them.

Also no surprise, there is some advocacy for the return to local fonts. Fast! Good enough! Let’s look at that for a sec, then also look at using them within SVG.

The trend isn’t just a return to local fonts but to what are being dubbed “system fonts”. The point isn’t so much a single font stack that looks consistent across browser/platform/version, but a single font stack that matches what that OS uses.

If the OS uses “San Francisco” in the UI, the font-stack should display San Francisco. If the OS uses Roboto, so it shall be. The actual font stack to do this is fairly thick. But that’s the point, just list a bunch of fonts in the order you want to use them and CSS will fall down the stack until it finds one it has.

Here’s what GitHub uses:

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

The WordPress admin and Medium interface are currently using this:

body {
  font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
}

The title of this post is about using these font stacks in SVG. There is nothing special or different or particularly interesting about this. You can apply that font stack via CSS inside the SVG, or just put it right on a text element:

<text font-family='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"' font-size="18" font-weight="400" fill="black" x="50" y="50">
  Some Text
</text>

Setting text in SVG is kinda awesome, as it retains its accessibility and is ultra-flexible.

Again, the point of all this is to match the font used by the OS, so let’s take a look at that. OS X is particularly interesting as the system font has changed several times in the last few years.

OS 10.0 – 10.9 – Lucida Grande
OS 10.10 – 10.11 – Helvetica Neue
OS 10.12 – San Francisco

Chrome DevTools will not only show you the font stack when you inspect an element, but also the Rendered Fonts.

OS 10.7 Showing us Lucida Grande

OS 10.10 showing us Helvetica Neue

OS 10.12 showing us San Franscisco

And here’s a totally different operating system:

Ubuntu 15 showing us Liberation Sans

Here’s a bunch of screenshots

Of this demo.

Windows 7 – Firefox

Windows 7 – Chrome

Windows 7 – IE 9

Windows 10 – Chrome

Windows 10 – Firefox

Windows 10 – Edge

Ubuntu 15 – Firefox

Ubuntu 15 – Chrome

The metrics of the different fonts are a bit different. The text fits a little tighter and looser depending on what renders. But it’s not too far off. You might not set a typographic lockup with system fonts, but all in all, very usable.


System Fonts in SVG is a post from CSS-Tricks

Source: CSSTricks

Alternative to DirectX and XNA?

Hey guys,

 

Hopefully a quick topic, but we’ll see…..!!

 

Been programming for years and played with multiple languages, engines and SDKs over the years.

It’s been awhile but I wanted to get back into it [game dev] again, and I’m trying to find out what I should use if I plan on coding in C++ (windows)

 

From what I understand DirectX and XNA etc etc are dead (or dying), so now what?

 

I’m working on a RPG game (currently console text based), but I’d like to take it to a 2D pixel style game.

Just pixel based background art with popup speech bubbles maybe and a hud for inventory etc etc

May move to animated pixel sprite/art later but right now just some basics.

 

Ideally something that can fullscreen and utilize the graphics card and not rely on crappy windows forms or GDI..

 

What are my options?

 

Thanks

Source: www.gamedev.net

TutsPlus.com: Building a Welcome Page for Your WordPress Product: Code Part 1

TutsPlus.com has started off a new series of posts for the WordPress users out there showing you how to build a "welcome page" for your WordPress site and product.

In the first two articles of this series, I wrote about what welcome pages are and how they are helping products improve user experience by connecting the dots, after which I wrote about the WordPress Transients API that I intend to use while building the welcome page.

Coding a welcome page for your WordPress plugin can be a tricky process. The entire concept revolves around redirecting users to a particular page via setting transients and finally deleting them. Let’s start building the welcome page.

They walk you through the creation of a simple plugin that can be used to easily create (and re-create) these "welcome" pages (the final result is here for the impatient). The tutorial the starts off by defining the architecture of the plugin and the workflow that it will follow to generate the page. From there it gets into the code for the plugin itself and related supporting files including the "initializer" that activates the plugin, making it ready for use.

Source: phpdeveloper.org

Need techniques for dealing with precision issues

I’ve got an AABB vs triangle collision detection implementation, but I’m running into some precision issues.

 

When the AABB is moved I compute the time of impact (a float in the range 0.0 – 1.0) and lerp the AABB to that time.  I then slide along the triangles sliding plane.

 

There are two things I’m noticing:

 

1. Precision issues with the time value.  If this value is slightly too large, then it will let the AABB clip through the triangle.

2. Computing the slide vector by projecting the velocity onto the triangles plane sometimes produces a vector that isn’t perfectly perpendicular with the triangle, thus collision is detected with the triangle being slid against causing the AABB to get “snagged” as its moving.

 

These issues are extremely difficult to reproduce but are more prevalent when the frame rate is uncapped and the delta time is extremely small.  I could bump into a wall N times with collision and then have it break on the Nth + 1 time.  I notice more precision issues against triangles with planes oriented in directions other then the primary axis e.g. (1, 0, 0), (0, 1, 0), (0, 0, 1) work fine.

 

What are some techniques for avoiding or correcting these issues and getting more deterministic behavior?

 

Also, what are good tips for debugging and unit testing these issues?

Source: www.gamedev.net

Best Note 7 MODs ( V4A, Xposed, 3imit…)

A while back TK made a video for XDA TV showing you how to root the Galaxy Note 7. Now if your phone is rooted and you’re wondering what to do next, you should check out some of these MODs. TK will walk you through how to install Xposed and what some of the best MODs are for the Galaxy Note 7.

If you own a Note 7 then let us know what MODs you’re using in the comments down below. If you haven’t rooted your device yet, be sure to check out the video on how to do that.

Source: xda-developers.com

Toptal.com: How Much Coding Should Designers Know?

The Toptal.com site has an interesting post mostly relevant to those out there that straddle the line between design and development. It wonders how much coding should a designer know to get the job done.

Many designers think each discipline should mind their own business, while others see no problem in professionals wearing multiple hats. Many developers see designers who code as a threat, while others see it as a facilitator. This is a hotly debated subject, and although I think some great designers are also superb at coding, I will always defend that the more you focus on a particular area the best you will be at it. But this shouldn’t be a reason for you to miss out on the benefits of having another skill under your belt.

The article then breaks down the benefits of designers learning to code by levels of knowledge:

  • Step 1: Know the basics of HTML and CSS
  • Step 2: Front-end JavaScript and AJAX could make you a unique asset
  • Step 3: Back-end JavaScript might be overkill
  • Step 4: Database Architecture and Software Engineering Won’t Get Designers Anywhere

For each point there’s a brief explanation of the level of knowledge it represents and what he sees as a general designers attitude towards it.

Source: phpdeveloper.org

Site News: Popular Posts for This Week (09.23.2016)

Popular posts from PHPDeveloper.org for the past week:

Source: phpdeveloper.org

How to separately discard in multiple rendering targets fragment?

Hi. There is a problem. I make billboard picking, and i render it in one pass with two gl_FragData. First – is a billboard image and second is a quad color mask. Billboards are transparent, and pixel with zero alpha discarded in fragment shader. I dont want to sort them)) And discard works fine, but it’s also discard zero pxels in second FragData, but I needn’t that. Could is it possible to make discard in first FragData, but not in a second?

 

P.S.

Sorting solves this but I dont want to sort. 

 

Thanks.

Source: www.gamedev.net

Provide a quick code-review of c++ code?

Apologies if my post is not quite according to the standards of this sub-forum but.. Would anyone want to take the time to do a code-review of my c++ code. Not a standard time intensive review, just review the main/only header and cpp files and review format, c++11 standards, idioms and any big no-no’s that stand out? The application is for my github portfolio.

 

The main application code is found in the Components folder. The bulk of the code resides in another repository (the CBA API) which please take a look at also although this hasn’t been refactored in a while.

 

https://github.com/sazr/WindowTiler

Source: www.gamedev.net