Skip to content

Feed aggregator

Are we done with icon fonts yet?

It seemed like a good idea at the time: wingdings for the web, collections of vector glyphs that are easy to include in your pages. Except that a web page is not a Word document. Now that SVG is properly supported by all half-decent browsers (you don’t have to support browsers and OS’s that Microsoft won’t, do you?), why are we still using icon fonts? Let’s recap.

In the case of Font Awesome, you’d be first including the style sheet:

<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">

That’s 28kB. Oh but that’s all right, it’s on a CDN, right? Well, first hits count.

Then, the style sheet will download the font itself. That’s 55kB in the case the woff file gets used.

Finally, you can start adding icons using those i tags:

<i class="fa fa-camera-retro"></i>

I tags, where of course, the i does not stand for “icon”, but for italic, for “a range of text that is set off from the normal text”. I think we should all prefer our images to be specified by image tags rather than italic tags.

If you’re using only a few of the icons in Font Awesome, the overhead is hard to justify, especially when compared with SVG. Let’s compare for a simple page: the Font Awesome “get started” page.

That page probably makes use of more icons than your typical page, so the comparison seems fair. A $('i.fa') gives me 24 uses of icons, 20 of which are unique (out of the set of 519 that Font Awesome provides). Changing those into SVG and CSS files that contain only the icons we need is really easy, as SVG is a text format, and Font Awesome comes with a SVG version of the font. With a text editor, removing what isn’t needed enabled me to bring the CSS size to under 5kB, and the SVG to less than 12kB. Compressed, that’s less than 4.5kB combined.

That we’d get substantially smaller resources by dropping the icons we don’t need is not exactly surprising however, and there are tools out there that will let you build your own custom icon font with your own glyphs, and that only contain what you need. So what’s the problem then?

Well, let’s see…

  • Icon fonts are flat and  monochromatic. To build icons that have more than one color, you need to stack glyphs. SVG on the other hand gives total freedom in terms of color and gradients.
  • Icon font animations are limited to what CSS provides, whereas SVG can use not only CSS animations, but also SMIL elements.
  • The inner structure of glyphs in icon fonts is fixed. With SVG, the glyph has its own DOM, that can be addressed and modified using both CSS and script.
  • Icon font files are smaller (woff is about 30% smaller than compressed SVG from my unscientific experiments). That’s one point for icon fonts, if you take the time to remove the fat.
  • Both icon fonts and SVG allow for spriting (putting more than one icon in a single file).
  • All vector graphic design tools support SVG export. Making a font requires additional steps and tools. This being said, any spriting technique requires tooling. There’s tooling for SVG sprites too.

Icon fonts are not that bad: they did enable vector graphics, which are a great way to deal with retina displays, to become mainstream. Icon libraries such as Font Awesome are extremely useful as glyph libraries that have a well-designed and consistent look and feel. The technology is however suboptimal. What I’m advocating is not to get rid of icon fonts, but instead that they move their focus to outputting SVG sprites rather than fonts, and that they make it easier to pick and choose only the glyphs that you need. Taking build systems such as Grunt into account couldn’t hurt, either…

Categories: Blogs

.NET Programmers Across the Globe

NCover - Code Coverage for .NET Developers - Mon, 03/02/2015 - 13:00

Our .NET community reaches across every nearly every country and continent – and I bet we can find some on Antarctica, if the weather is right. Today we wanted to highlight two of our .NET programmers spanning the globe.

Elemar Rodrigues Severo Junior

ncover_mvp_elemar_junior_twitterElemar was just 8 years old when he stumbled upon creating computer programs. Lucky for us – he still does!

Since 1998, he has focused all his time creating solutions for the Brazilian furniture industry, including 3D Interior Design, industrial automation, sales and management software. Because of this, he has been learning, teaching and using a lot of different technologies (like OpenGL, DirectX, .NET, NodeJS, MongoDB – WHEW!) and languages (like C#, C++, LISP, Objective-C, JavaScript).

He is a Microsoft Visual C# MVP, software architect, developer, speaker, consultant and trainer specialized in professional application development with Microsoft Technologies. You can check him out on his blog, podcast and twitter @elemarjr.

Caio Proiete

Caio Proiete is a trainer on Microsoft technologies and products. He is a Microsoft Certified Trainer (MCT) since 2004, and is also an ASP.NET Microsoft MVP since 2009, due to his active contributions to technical communities in Portugal and Brazil.

He may look familiar to you. He has been speaking at the major Microsoft events in Portugal, mostly about software development on ASP.NET, Windows Phone, Windows Azure, and more recently Windows 8 Metro Style apps. He also runs the NetPonto .NET User Group, where he organizes in-person events every month with technical sessions about software development on the Microsoft .NET platform, and was speaker in several events, including TechDays Portugal and WebDay.

His current topics of interest include ASP .NET MVC, HTML5, JavaScript, jQuery, Windows 8 Metro style applications, Silverlight for Web, Silverlight for Windows Phone and Windows Azure. Keep up with him at his blog or on twitter @CaioProiete

The post .NET Programmers Across the Globe appeared first on NCover.

Categories: Companies

That ain’t going to take you anywhere

Ayende @ Rahien - Mon, 03/02/2015 - 11:00

As part of our usual work routine, we field customer questions and inquiries. A pretty common one is to take a look at their system to make sure that they are making a good use of RavenDB.

Usually, this involves going over the code with the team, and making some specific recommendations. Merge those indexes, re-model this bit to allow for this widget to operate more cleanly, etc.

Recently we had such a review in which what I ended up saying is: “Buy a bigger server, hope this work, and rewrite this from scratch as fast as possible”.

The really annoying thing is that someone who was quite talented has obviously spent a lot of time doing a lot of really complex things to end up where they are now. It strongly reminded me of this image:

image

At this point, you can have the best horse in the world, but the only thing that will happen if it runs is that you are going to be messed up.

What was so bad? Well, to start with, the application was designed to work with a dynamic data model. That is probably also why RavenDB was selected, since that is a great choice for dynamic data.

Then the designers sat down and created the following system of classes:

public class Table
{
	public Guid TableId {get;set;}
	public List<FieldInformation> Fields {get;set;}
	public List<Reference> References {get;set;}
	public List<Constraint> Constraints {get;set;}
}

public class FieldInformation
{
	public Guid FieldId {get;set;}
	public string Name {get;set;}
	public string Type {get;set;}
	public bool Required {get;set;}
}

public class Reference
{
	public Guid ReferenceId {get;set;}
	public string Field {get;set;}
	public Guid ReferencedTableId {get;set;}
}

public class Instance
{
	public Guid InstanceId {get;set;}
	public Guid TableId {get;set;}
	public List<Guid> References {get;set;}
	public List<FieldValue> Values {get;set;}
}

public class FieldValue
{
	public Guid FieldId {get;set;}
	public string Value {get;set;}
}

I’ll let you draw your own conclusions about how the documents looked like, or just how many calls you needed to load a single entity instance.

For that matter, it wasn’t possible to query such a system directly, obviously, so they created a set of multi-map/reduce indexes that took this data and translated that into something resembling a real entity, then queried that.

But the number of documents, indexes and the sheer travesty going on meant that actually:

  • Saving something to RavenDB took a long time.
  • Querying was really complex.
  • The number of indexes was high
  • Just figuring out what is going on in the system was nigh impossible without a map, a guide and a lot of good luck.

Just to cap things off, this is a .NET project, and in order to connect to RavenDB they used direct REST calls using HttpClient. Blithely ignoring all the man-decades that were spent in creating a good client side experience and integration. For example, they made no use of Etags or Not-Modified-Since, so a lot of the things that RavenDB can do (even under such… hardship) to make things better weren’t supported, because the client code won’t cooperate.

I don’t generally say things like “throw this all away”, but there is no mid or long term approach that could possibly work here.

Categories: Blogs

SharePoint REST API to Get and Bind Data With Knockout.js

C-Sharpcorner - Latest Articles - Mon, 03/02/2015 - 08:00
This article shows how to get data from a list of SharePoint REST API and bind to HTML controls in a simple way using Knockout.js.
Categories: Communities

Deploy ASP.Net 5 Applications in Linux Containers With Docker

C-Sharpcorner - Latest Articles - Mon, 03/02/2015 - 08:00
This article explains how to run an application on the Linux operating system using Docker.
Categories: Communities

Difference Between ViewData, ViewBag, TemData and Session in MVC

C-Sharpcorner - Latest Articles - Mon, 03/02/2015 - 08:00
This article shows how to pass a data controller to a view using ViewData, ViewBag, TempData and Session in MVC and the differences.
Categories: Communities

Office 365: How to Add an App in Excel Online From Office Store

C-Sharpcorner - Latest Articles - Mon, 03/02/2015 - 08:00
This article shows how to add an app in Excel Online from the Office Store.
Categories: Communities

Windows Form Design at Run Time

C-Sharpcorner - Latest Articles - Mon, 03/02/2015 - 08:00
In this article you will learn how to design Windows Forms at runtime.
Categories: Communities

New Keyboard Shortcuts in Windows 10

C-Sharpcorner - Latest Articles - Mon, 03/02/2015 - 08:00
This article intends to introduce some of the new keyword shortcuts in Windows 10.
Categories: Communities

Creating a Power View Report With Azure Marketplace Data

C-Sharpcorner - Latest Articles - Mon, 03/02/2015 - 08:00
In this article we will learn creating a Power View report with Azure Marketplace data and creating relationships between the tables.
Categories: Communities

POCO Classes in Entity FrameWork

C-Sharpcorner - Latest Articles - Mon, 03/02/2015 - 08:00
In this article you will learn about POCO Classes in Entity Framework.
Categories: Communities

An Open Source Project: R-VisitorManagementSystem

C-Sharpcorner - Latest Articles - Mon, 03/02/2015 - 08:00
This is my open source project named R-VisitorManagementSystem.
Categories: Communities

SharePoint: Deleting the Web Part From Page Using PowerShell Scripts

C-Sharpcorner - Latest Articles - Mon, 03/02/2015 - 08:00
In this article you will learn how to delete a Web Part from a page using PowerShell scripts in SharePoint.
Categories: Communities

WPF Layout: Margins

C-Sharpcorner - Latest Articles - Mon, 03/02/2015 - 08:00
In the previous article, WPF Layout: Size, Width, and Height, I discussed how to manage the size of elements. Margins are another vital piece of the layout system. This article focuses on the margins only.
Categories: Communities

Exception Handling in SQL Server

C-Sharpcorner - Latest Articles - Mon, 03/02/2015 - 08:00
In this article you will learn about SQL Server Exception Handling.
Categories: Communities

Create Custom Permission Level in SharePoint

C-Sharpcorner - Latest Articles - Mon, 03/02/2015 - 08:00
In this article we explore how to create a custom permission level.
Categories: Communities

Useful C# Windows Forms Input Masks

C-Sharpcorner - Latest Articles - Sun, 03/01/2015 - 08:00
In this article we will learn about useful C# Windows Forms Input Masks.
Categories: Communities

Render Same Page With Multiple URLs Using Route Engine in ASP.Net MVC 5

C-Sharpcorner - Latest Articles - Sun, 03/01/2015 - 08:00
In this article you will learn how to render the same page with multiple URLs using the Route Engine in ASP.NET MVC 5.
Categories: Communities

Updating App.Config File Dynamically

C-Sharpcorner - Latest Articles - Sun, 03/01/2015 - 08:00
This article helps you in updating the application configuration file dynamically. The change in settings reflects to the application without a need to restart.
Categories: Communities

Magic of App_offline.htm File in ASP.Net

C-Sharpcorner - Latest Articles - Sun, 03/01/2015 - 08:00
This article explains the app_offline.htm file and how to use it for taking you to an ASP.NET web application offline within seconds.
Categories: Communities