@@ -0,0 +1,3 @@
|
|||||||
|
*.o
|
||||||
|
/woff2_compress
|
||||||
|
/woff2_decompress
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
OS := $(shell uname)
|
||||||
|
|
||||||
|
IDIRS=-I./brotli/dec/ -I./brotli/enc/ -I./src
|
||||||
|
|
||||||
|
CXX = g++
|
||||||
|
LFLAGS =
|
||||||
|
GFLAGS=-no-canonical-prefixes -fno-omit-frame-pointer -m64
|
||||||
|
CXXFLAGS = -c $(IDIRS) -std=c++0x $(GFLAGS)
|
||||||
|
|
||||||
|
ifeq ($(OS), Darwin)
|
||||||
|
CXXFLAGS += -DOS_MACOSX
|
||||||
|
else
|
||||||
|
CXXFLAGS += -fno-tree-vrp
|
||||||
|
endif
|
||||||
|
|
||||||
|
SRCDIR = src
|
||||||
|
|
||||||
|
OUROBJ = font.o glyph.o normalize.o table_tags.o transform.o \
|
||||||
|
woff2_dec.o woff2_enc.o
|
||||||
|
|
||||||
|
BROTLI = brotli
|
||||||
|
ENCOBJ = $(BROTLI)/enc/*.o
|
||||||
|
DECOBJ = $(BROTLI)/dec/*.o
|
||||||
|
|
||||||
|
OBJS = $(patsubst %, $(SRCDIR)/%, $(OUROBJ))
|
||||||
|
EXECUTABLES=woff2_compress woff2_decompress
|
||||||
|
|
||||||
|
EXE_OBJS=$(patsubst %, $(SRCDIR)/%.o, $(EXECUTABLES))
|
||||||
|
|
||||||
|
all : $(OBJS) $(EXECUTABLES)
|
||||||
|
|
||||||
|
$(EXECUTABLES) : $(EXE_OBJS) deps
|
||||||
|
$(CXX) $(LFLAGS) $(OBJS) $(ENCOBJ) $(DECOBJ) $(SRCDIR)/$@.o -o $@
|
||||||
|
|
||||||
|
deps :
|
||||||
|
make -C $(BROTLI)/dec
|
||||||
|
make -C $(BROTLI)/enc
|
||||||
|
|
||||||
|
clean :
|
||||||
|
rm -f $(OBJS) $(EXE_OBJS) $(EXECUTABLES)
|
||||||
|
make -C $(BROTLI)/dec clean
|
||||||
|
make -C $(BROTLI)/enc clean
|
||||||
@@ -4,9 +4,7 @@ compression related modules in this repository.
|
|||||||
brotli/ contains reference code for the Brotli byte-level compression
|
brotli/ contains reference code for the Brotli byte-level compression
|
||||||
algorithm. Note that it is licensed under an Apache 2 license.
|
algorithm. Note that it is licensed under an Apache 2 license.
|
||||||
|
|
||||||
woff2/ contains the C++ code for compressing and decompressing fonts.
|
src/ contains the C++ code for compressing and decompressing fonts.
|
||||||
|
|
||||||
docs/ contains documents describing the proposed compression format.
|
|
||||||
|
|
||||||
# Build & Run
|
# Build & Run
|
||||||
|
|
||||||
@@ -24,7 +22,6 @@ git clone https://github.com/google/woff2.git
|
|||||||
cd woff2
|
cd woff2
|
||||||
git submodule init
|
git submodule init
|
||||||
git submodule update
|
git submodule update
|
||||||
cd woff2
|
|
||||||
make clean all
|
make clean all
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
-5500
File diff suppressed because it is too large
Load Diff
@@ -1,17 +0,0 @@
|
|||||||
OS := $(shell uname)
|
|
||||||
IDIRS=-I../brotli/dec/ -I../brotli/enc/ -I../
|
|
||||||
|
|
||||||
GFLAGS=-no-canonical-prefixes -fno-omit-frame-pointer -m64
|
|
||||||
|
|
||||||
CPP = g++
|
|
||||||
LFLAGS =
|
|
||||||
CPPFLAGS = -c $(IDIRS) -std=c++0x $(GFLAGS)
|
|
||||||
|
|
||||||
ifeq ($(OS), Darwin)
|
|
||||||
CPPFLAGS += -DOS_MACOSX
|
|
||||||
else
|
|
||||||
CPPFLAGS += -fno-tree-vrp
|
|
||||||
endif
|
|
||||||
|
|
||||||
%.o : %.c
|
|
||||||
$(CPP) $(CPPFLAGS) $< -o $@
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
#Converter makefile
|
|
||||||
|
|
||||||
include ../shared.mk
|
|
||||||
|
|
||||||
OUROBJ = font.o glyph.o normalize.o table_tags.o transform.o \
|
|
||||||
woff2_dec.o woff2_enc.o
|
|
||||||
|
|
||||||
BROTLI = ../brotli
|
|
||||||
ENCOBJ = $(BROTLI)/enc/*.o
|
|
||||||
DECOBJ = $(BROTLI)/dec/*.o
|
|
||||||
|
|
||||||
OBJS = $(OUROBJ)
|
|
||||||
EXECUTABLES=woff2_compress woff2_decompress
|
|
||||||
|
|
||||||
EXE_OBJS=$(patsubst %, %.o, $(EXECUTABLES))
|
|
||||||
|
|
||||||
all : $(OBJS) $(EXECUTABLES)
|
|
||||||
|
|
||||||
$(EXECUTABLES) : $(EXE_OBJS) deps
|
|
||||||
$(CPP) $(LFLAGS) $(OBJS) $(ENCOBJ) $(DECOBJ) $@.o -o $@
|
|
||||||
|
|
||||||
deps :
|
|
||||||
make -C $(BROTLI)/dec
|
|
||||||
make -C $(BROTLI)/enc
|
|
||||||
|
|
||||||
clean :
|
|
||||||
rm -f $(OBJS) $(EXE_OBJS) $(EXECUTABLES)
|
|
||||||
make -C $(BROTLI)/dec clean
|
|
||||||
make -C $(BROTLI)/enc clean
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
# Copyright (c) 2012 Google Inc. All rights reserved.
|
|
||||||
# Use of this source code is governed by a BSD-style license that can be
|
|
||||||
# found in the LICENSE file.
|
|
||||||
|
|
||||||
# This is a simple utility for dumping out the header of a compressed file, and
|
|
||||||
# is suitable for doing spot checks of compressed. files. However, this only
|
|
||||||
# implements the "long" form of the table directory.
|
|
||||||
|
|
||||||
import struct
|
|
||||||
import sys
|
|
||||||
|
|
||||||
def dump_woff2_header(header):
|
|
||||||
header_values = struct.unpack('>IIIHHIHHIIIII', header[:44])
|
|
||||||
for i, key in enumerate([
|
|
||||||
'signature',
|
|
||||||
'flavor',
|
|
||||||
'length',
|
|
||||||
'numTables',
|
|
||||||
'reserved',
|
|
||||||
'totalSfntSize',
|
|
||||||
'majorVersion',
|
|
||||||
'minorVersion',
|
|
||||||
'metaOffset',
|
|
||||||
'metaOrigLength',
|
|
||||||
'privOffset',
|
|
||||||
'privLength']):
|
|
||||||
print key, header_values[i]
|
|
||||||
numTables = header_values[3]
|
|
||||||
for i in range(numTables):
|
|
||||||
entry = struct.unpack('>IIIII', header[44+20*i:44+20*(i+1)])
|
|
||||||
print '%08x %d %d %d %d' % entry
|
|
||||||
|
|
||||||
def main():
|
|
||||||
header = file(sys.argv[1]).read()
|
|
||||||
dump_woff2_header(header)
|
|
||||||
|
|
||||||
main()
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user