Everything2
Near Matches
Ignore Exact
Full Text
Everything2

Embed

created by forte-x

(thing) by Erik Fish (1.8 mon) (print)   ?   (I like it!) Thu May 02 2002 at 15:27:26

By default many of the programs used for authoring TrueType fonts set the "allow embedding" bits to false. Because this is an obscure setting it is often overlooked and thus many fonts that were not intended to be restricted have been released with it set. Embed flips these bits so that software which actually pays attention to them (such as Adobe Distiller) will play nice.

See Cracking TrueType Fonts or the official embed site (http://www.andrew.cmu.edu/~twm/embed/) for more information.

This is the source code for the embed utility. The author claims that this requires a 32 bit Windows or a DOS extender (cwsdpmi.exe) to run, but my theory is that it will work flawlessly under WINE or any DOS emulator that supports extenders.



/*
 * This program is for setting TTF files to Installable Embedding mode.
 *
 * Note that using this to embed fonts which you are not licensed to embed
 * does not make it legal.
 *
 * This code was written by Tom Murphy 7, and is public domain. Use at your
 * own risk...
*/

#include <stdio.h>
#include <stdlib.h>

void fatal();

int main (int argc, char**argv) {
     FILE * inways;
     if (argc != 2)
        printf("Usage: %s font.ttf\n\nPublic Domain software by Tom 7. 
		Use at your own risk.\n",argv[0]);
     else if (inways = fopen(argv[1],"rb+")) {
        int a,x;
        char type[5];
        type[4]=0;
        fseek(inways,12,0);
        for (;;) {
           for (x=0;x<4;x++) if (EOF == (type[x] = getc(inways))) fatal();
           if (!strcmp(type,"OS/2")) {
              int length;
              unsigned long loc, fstype, sum=0;
              loc=ftell(inways); /* location for checksum */
              for (x=4;x--;) if (EOF == getc(inways)) fatal();
              fstype  = fgetc(inways) << 24;
              fstype |= fgetc(inways) << 16;
              fstype |= fgetc(inways) << 8 ;
              fstype |= fgetc(inways)      ;
              length  = fgetc(inways) << 24;
              length |= fgetc(inways) << 16;
              length |= fgetc(inways) << 8 ;
              length |= fgetc(inways)      ;
/*              printf("fstype: %d length: %d\n",fstype,length);*/
              if (fseek(inways,fstype+8,0)) fatal();
              fputc(0,inways);
              fputc(0,inways);
              fseek(inways,fstype,0);
              for (x=length;x--;)
                  sum += fgetc(inways);
              fseek(inways,loc,0); /* write checksum */
              fputc(sum>>24,inways);
              fputc(255&(sum>>16),inways);
              fputc(255&(sum>>8), inways);
              fputc(255&sum    ,  inways);
              fclose(inways);
              exit(0);
           }
           for (x=12;x--;) if (EOF == getc(inways)) fatal();
        }

     } else
        printf("I wasn't able to open the file %s.\n", argv[1]);
}

void fatal() { fprintf(stderr,"Malformed TTF file.\n");
               exit(-1); }

(definition) by Webster 1913 (print) Tue Dec 21 1999 at 23:21:07

Em*bed" (?), v. t. [imp. & p. p. Embedded; p. pr. & vb. n. Embedding.] [Pref. em- + bed. Cf. Imbed.]

To lay as in a bed; to lay in surrounding matter; to bed; as, to embed a thing in clay, mortar, or sand.

 

© Webster 1913.


printable version
chaos

Cracking TrueType Fonts Women who want to fuck, just to pay the bills embedded embedded journalist
E2 HTML tags gel candle Embedded system dynamic fonts
Fear of the Back button HTML tags M60 Armored Vehicle-Launched MICLIC Staregirl
made up of wires bgsound Holiday In Spain B
George Washington's 1790 State of the Union Address KB George Washington's 1792 State of the Union Address embedded value
The micromanaging of war Tomorrow Shall be my Dancing Day Ritz Bits Visual Basic
Y'know, if you log in, you can write something here, or contact authors directly on the site. Create a New User if you don't already have an account.
  Epicenter
Login
Password

password reminder
register

Everything2 Help

Cool Staff Picks
Just another sprinkling of indeterminacy
Dizzy and Katyana's Wedding Vows
Russell's paradox
Roe v. Wade
All you need is love
It's only love: at the end of the day, there are still thunderstorms and sunsets
I called for the Emergency Destruct Plan
Paul Wellstone
The Truman Show
The top secret of talking like an American
Yezidi
Vanishing Act
Philobiblon
Polar bear
New Writeups
Meezzio
Gotlandssnus(thing)
argv
Astral Plane(idea)
Madara
One Winged Angel(fiction)
Tom Rook
Talk is cheap(poetry)
shaogo
Adelle Davis(person)
Aerobe
race car g sfjsgsd(poetry)
Binah
Dream Log: July 5, 2008(dream)
StrawberryFrog
Forgotten things in space(idea)
antigravpussy
velvet revolution fairy tale(idea)
Heitah
Nerve agent VX(thing)
Pavlovna
shite(idea)
wonton
Days and nights come together in a slow falling down(fiction)
Pavlovna
wee(idea)
katherine
root log: July 2008(log)
Madara
There’s nothing like a trail of blood to find your way back home(fiction)
This page courtesy of The Everything Development Company