Tag Archives: links

Font-Face generator

@font-face Kit Generator at fontsquirrel.com
@font-face Kit Generator User Interface

CSS3 allows you to create custom font-faces so a user will see fonts exactly as you’d like them to be seen, without forcing the developer/designer to export all custom fonts as graphics.

Font Squirrel has an excellent utility that will convert your font files to the common formats and generate the stylesheet required to use these new font-faces.  That generator can be found here.  The generator creates a demo.html file that displays all of your newly created fonts.

As an example, the header text on this site uses a custom font.  Go ahead and view the source and see how it works.

Flattr this!

IHttpModule Gotchas @dominicpettifer.co.uk

I came across this blog post about the Init() method of an HttpModule being called more than once. The solution is simple: create a boolean flag to indicate whether or not the app is started and an empty object to lock. Then, in the Init() method, check the flag, lock the object, then check the flag again before performing any application code.

For example:

private static bool HasAppStarted = false; 
private readonly static object _syncObject = new object(); 
 
public void Init(HttpApplication context) 
{ 
    if (!HasAppStarted) 
    { 
        lock (_syncObject) 
        { 
            if (!HasAppStarted) 
            { 
                // Run application StartUp code here 
 
                HasAppStarted = true; 
            } 
        } 
    } 
}

The full blog post can be viewed here.

I was directed to the above post via The Morning Brew.

Flattr this!