元タイ人留学生がのぞいたタイランド

元タイ人留学生が日本語で綴るタイのIT事情

4

2024


  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30        

検索


カテゴリーリスト

タグリスト

2010年03月29日(月)

MacOSの隠しファイルを表示する方法 [タイの電脳事情 電脳街情報]

表示する
defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder

非表示
defaults write com.apple.finder AppleShowAllFiles FALSE
killall Finder

Posted by ぷーちゃん at 08時38分   パーマリンク

2010年01月28日(木)

iPadの発表 [タイの電脳事情 電脳街情報]

アップルの新商品が発表されました。その名はiPadです。iPhoneとmacBookの溝を埋め合わすためだそうです。重さは0.68Kg、お手ごろな値段(iPad WiFi 499US$)で3月頃アメリカで発売される予定です。

またiPad WiFi + 3Gモデル(829US$)は4月末からだそうです。
とても魅力的な商品です。

画像(229x320)・拡大画像(300x418)

Posted by ぷーちゃん at 10時57分   パーマリンク

2009年11月29日(日)

TrueType Font のファイル形式 [タイの電脳事情 電脳街情報]

画像(320x281)・拡大画像(370x325)

TrueType Fontのファイル形式を解析してみました。以下はTahoma.ttfを読み込んだ結果です。見た感じ、テーブル内のTAGは二分探索を行うときに必要な項目です。フォントサイズを計算するとき、最大のOffset値を持っているテーブルを求めて、その値にテーブルの長さ(Length)を足せばいいです。

ここまでなら、プログラミング自体は難しくなかったのですが、TTFのファイル構造を理解するのに少し時間がかかりました。残りはグリフと文字コードの関係を調べる作業がありますが、かなり大きな構造体を理解する必要があるので、それなりに時間がないと終わらないと思います。

The offset subtable
===================
   scaler type      : 0x00010000
   number of tables : 22
   search range     : 256
   entry selector   : 4
   range shift      : 96


             The table directory
-------------------------------------------------
table   tag    checksum       offset       length
-------------------------------------------------
 1      DSIG   FCFE875A        A406C         2434
 2      GDEF   F02BF75F        95960          340
 3      GPOS   C6F70E96        9793C         B83A
 4      GSUB   B2491028        95CA0         1C9C
 5      LTSH   C7CA55B2         35DC          CE9
 6      OS/2   D6425AC4          1E8           60
 7      VDMX   76D97D56         42C8          5E0
 8      cmap   31408F48        A3178          EF2
 9      cvt    89B4966C        1E438          308
10      fpgm   FE40EAFD        1D8C8          5BC
11      gasp   00170009        95950           10
12      glyf   FEAFC82C        21AD8        6A3FC
13      hdmx   BD46C5E9         48A8        19020
14      head   D84F7FD5          16C           36
15      hhea   0F58121F          1A4           24
16      hmtx   9F0772BB          248         3394
17      kern   ADC4AF0B        8BED4          FDE
18      loca   2C92213E        1E740         3398
19      maxp   11010415          1C8           20
20      name   3AC16DD0        8CEB4          816
21      post   FE8B50AA        8D6CC         8281
22      prep   E1E8DA4C        1DE84          5B1
-------------------------------------------------
The last table is:
DSIG   FCFE875A        A406C         2434
Last byte = A64A0
// the font directory consists of two parts:
// part 1. the offset subtable - 12 bytes
// note: for the scaler type
//     - fonts produced specifically for Mac OS 
//             should be 0x74727565 ('true')
//     - fonts for MS Windows must use 0x000100 
//             (version no).
// --------------------------------------------
typedef struct {
     byte       scaler[4];              // scaler type, see note
     word       tables;                 // number of tables
     word       range;                  // search range
     word       select;                 // entry selector
     word       shift;                  // range shift
} offtab;

// part 2. the table directory - 16 bytes
// note: entries in the table directory must be sorted 
//       inascending order by tag.
// ---------------------------------------------------
typedef struct {
     byte       tag[4];                 // 4-byte identifier
     dword      chksum;                 // this table checksum
     dword      offset;                 // offset from the beginning of sfnt
     dword      length;                 // actual table length in bytes
} tabdir;                               // (not including pads)

// function prototypes
// -------------------
void   help ( char   *pname );
void   readOffset ( offtab   *tab, FILE   *fp );
void   dispOffset ( const offtab   *tab );
void   readTabdir ( tabdir   *tab, FILE   *fp );
void   dispTabdir ( tabdir   *tab );
void   dispHead ( void );
void   line ( int   n );


// --------------------------
//   M A I N  P R O G R A M  
// --------------------------
int
main ( int   argc, char  *argv[] )
{
     FILE       *ttf;           // TrueType font file
     offtab     otab;           // offset subtable 
     tabdir     dtab;           // table directory
     tabdir     mtab;
     int        k;
     dword      max = 0;        // maximum offset

     
     // ttf filename is supplied?
     // -------------------------
     if ( argc < 2 ) 
          help(argv[0]);

     ttf = jopen(argv[1], "rb");

     // read and display offset subtable
     readOffset(&otab, ttf);
     dispOffset(&otab);


     // read data, store in the table directory, and display
     // one table at a time
     // ----------------------------------------------------
     dispHead();
     for ( k = 0; k < otab.tables; ++k ) {
          readTabdir(&dtab, ttf);

          printf("%2d      ", k+1);
          dispTabdir(&dtab);
          if ( dtab.offset > max ) {
               max = dtab.offset;
               mtab = dtab;
          }
     }
     line(49);

     printf("The last table is:¥n"); 
     dispTabdir(&mtab);
     printf("Last byte = %X¥n", mtab.offset + mtab.length);

     jclose(ttf);

     return 0;
}
// help - display application's usage information
// ----------------------------------------------
void
help ( char   *pname )
{
     printf("usage : %s  <TrueType-font-file.ttf>¥n", pname);
     exit(1);
}

// readOffset - read the offset subtable, one element at a time
// to avoid alignment prooblem; fixed size = 12 bytes
// ------------------------------------------------------------
void
readOffset ( offtab   *tab, FILE   *fp )
{
     jread(&tab->scaler, sizeof(tab->scaler), fp);
     jread(&tab->tables, sizeof(tab->tables),  fp); 
     jread(&tab->range,  sizeof(tab->range),  fp); 
     jread(&tab->select, sizeof(tab->select), fp); 
     jread(&tab->shift,  sizeof(tab->shift),  fp); 

     // flip 16-bit data from host to network byte order
     // ------------------------------------------------
     tab->tables = flip16(tab->tables);
     tab->range  = flip16(tab->range);
     tab->select = flip16(tab->select);
     tab->shift  = flip16(tab->shift);
}

// dispOffset - display the offset subtable
// ----------------------------------------
void
dispOffset ( const offtab   *tab )
{
     int        i;

     printf("¥n");
     printf("The offset subtable¥n");
     printf("===================¥n");
     printf("   scaler type      : 0x");
     for ( i = 0; i < 4; ++i )
               printf("%02X", tab->scaler[i]);
     printf("¥n");
     printf("   number of tables : %d¥n", tab->tables);
     printf("   search range     : %d¥n", tab->range);
     printf("   entry selector   : %d¥n", tab->select);
     printf("   range shift      : %d¥n", tab->shift);
     printf("¥n");
}


// readTabdir - read the table directory, one element at a time
// to avoid alignment prooblem; fixed size = 16 bytes
// ------------------------------------------------------------
void
readTabdir ( tabdir   *tab, FILE   *fp )
{
     jread(&tab->tag,    sizeof(tab->tag),    fp);
     jread(&tab->chksum, sizeof(tab->chksum), fp); 
     jread(&tab->offset, sizeof(tab->offset), fp); 
     jread(&tab->length, sizeof(tab->length), fp); 

     // flip 32-bit data from host to network byte order
     // ------------------------------------------------
     tab->chksum = flip32(tab->chksum);
     tab->offset = flip32(tab->offset);
     tab->length = flip32(tab->length);
}


// dispTabdir - display the table directory
// ----------------------------------------
void
dispTabdir ( tabdir   *tab )
{
     int        i;
     int        n = sizeof(tab->tag);

     for ( i = 0; i < n; ++i )
               printf("%c", (char)tab->tag[i]);
     printf("   ");
     printf("%08X     ", tab->chksum);
     printf("%8X       ", tab->offset);
     printf("%6X¥n", tab->length);
}

// dispHead - head of the table directory display
// ----------------------------------------------
void
dispHead ( void )
{
     printf("¥n");
     printf("             The table directory¥n");
     line(49);
     printf("table   tag    checksum       offset       length¥n");
     line(49);
}
// line - display a line of length 'n' 
// -----------------------------------
void
line ( int   n )
{
     int        i;

     for ( i = 0; i < n; ++i )
          putchar('-');
     putchar('¥n');
}


Posted by ぷーちゃん at 17時26分   パーマリンク

iPod nano のタイ語表示 [タイの電脳事情 電脳街情報]

IMG_5078

大変お待たせしました。最近タイとアメリカサイトのGPSフォーラムに出入りしているので、ついブログをサボってしまいました。ipod nanoのタイ語表示は写真の通りです。完全にタイ語をサポートしているようです。

Posted by ぷーちゃん at 13時01分   パーマリンク

2009年09月26日(土)

ワード文書保護 [タイの電脳事情 電脳街情報]

備忘録です。チェックサム(CRC32)をクリアすればいいらしいです。CRC32の値はワードをHTML形式に書き出したら、そのまま出力されるので、その値をHEXエディタでクリアすればいいです。詳細は下記の英語を読んでください。

When saving protected Word-documents as html-files, Word adds a "checksum" of the password (enclosed in a proprietary tag) to the code. The checksum format looks somewhat like CRC32 but currently there are no further details available. The same checksum can be found within the original Word document (hexadecimal view). If this "checksum" is replaced by 0x00000000, the password equals an empty string.

Example:
1.) Open a protected document in MS Word
2.) Save as "Web Page (*.htm; *.html)", close Word
3.) Open html-document in any Text-Editor
4.) Search "" tag, the line reads something like that: ABCDEF01
5.) Keep the "password" in mind
6.) Open original document (.doc) with any hex-editor
7.) Search for hex-values of the password (reverse order!)
8.) Overwrite all 4 double-bytes with 0x00, Save, Close
9.) Open document with MS Word, Select "Tools / Unprotect Document" (password is blank)

Variation:
If the 8 checksum bytes are replaced with the checksum of a known password it should be fairly easy to unprotect the document, make any necessary changes, save, close and reset the password to the original (unknown!) password by simply restoring the original values. Document changed without even knowing the password.

reference:http://www.securiteam.com/windowsntfocus/5MP0315BPS.html

Posted by ぷーちゃん at 16時01分   パーマリンク

過去の記事へ

ページのトップへ ページのトップへ

PHOTO

ADOBE CS2用のタイ語入力プラグイン

ADOBE CS2用のタイ語入力プラグイン

セブンイレブンのバリューカード

セブンイレブンのバリューカード

パソコンをバックアップしていますか?

パソコンをバックアップしていますか?

最近の記事

最近のコメント

最近のトラックバック

リンク集

RSS1.0

[Login]


powered by a-blog
コミュ ニケーションをもっと快適に タイ語翻訳会社ジーアイピーユー