Skip to content
This repository has been archived by the owner on Jul 26, 2021. It is now read-only.

Commit

Permalink
* первая условно рабочая редакция с ресурсами уже без расширений (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
sergey-s-betke committed Jul 3, 2018
1 parent e5257b0 commit dc3e677
Show file tree
Hide file tree
Showing 20 changed files with 49 additions and 21 deletions.
12 changes: 5 additions & 7 deletions ITG.MakeUtils/ghostscript.mk
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,16 @@ endif
GS = $(GSTOOL) \
-dSAFER \
-dNOPAUSE \
-dNOPLATFONTS \
-dLOCALFONTS \
-dBATCH

GSINCDIR ?= %rom%Resource/Init/
GSINCDIR ?= %rom%Resource/
GSFONTDIR ?=
PSRESOURCEOUTPUTDIR ?= $(OUTPUTDIR)Resource/
PSGENERICRESOURCEDIR = $(PSRESOURCEOUTPUTDIR)
PSRESOURCESOURCEDIR ?= ./
ENCODINGRESOURCEDIR := Encoding/
PROCSETRESOURCEDIR := ProcSet/
FONTRESOURCEDIR := Font/
RESOURCEDIRSUBDIRS = $(ENCODINGRESOURCEDIR) $(PROCSETRESOURCEDIR)

$(PSRESOURCEOUTPUTDIR) $(PSRESOURCEOUTPUTDIR)$(ENCODINGRESOURCEDIR) $(PSRESOURCEOUTPUTDIR)$(PROCSETRESOURCEDIR):
Expand Down Expand Up @@ -61,10 +60,9 @@ endef


GSCMDLINE = $(GS) \
-sCOMPILE_INITS=1 \
$(if $(PSGENERICRESOURCEDIR),-sGenericResourceDir='$(PSGENERICRESOURCEDIR)') \
$(foreach incdir,$(GSINCDIR), -I'$(incdir)') \
$(if $(GSFONTDIR),-sFONTPATH='$(foreach fontdir,$(GSFONTDIR),$(fontdir)$(PATHSEP))')
$(foreach incdir,$(GSINCDIR), -I'$(strip $(incdir))') \
$(if $(GSFONTDIR),-sFONTPATH='$(subst $(SPACE),$(PATHSEP),$(strip $(GSFONTDIR)))')

GSPSTOPDFCMDLINE = $(GSCMDLINE) \
-sDEVICE=pdfwrite
Expand Down Expand Up @@ -98,7 +96,7 @@ definePostScriptTests = $(foreach test,$(TESTSPSFILES),$(call definePostScriptTe
define definePostScriptBuildTest

$(call defineTest,$(basename $(notdir $1)),ps_build,\
$(GSPSTOPDFCMDLINE) -q -sOutputFile='$1' '$2';\
$(GSPSTOPDFCMDLINE) -sOutputFile='$1' '$2';\
$$(call pushDeploymentArtifactFile,$$(notdir $1),$1);,\
$2 $3 \
)
Expand Down
9 changes: 6 additions & 3 deletions ITG.PostScriptLib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@ $(eval $(call copyPostScriptResource))
GSINCDIR := $(GSINCDIR) $(PSRESOURCEOUTPUTDIR)

PSLIBSRCFILES := $(call getPostScriptResourceSourceFiles)
PSLIBFILES := $(call getPostScriptResourceOutputFiles)
ITG_POSTSCRIPTLIBFILES := $(call getPostScriptResourceOutputFiles)
ITG_POSTSCRIPTLIBDIR := $(PSRESOURCEOUTPUTDIR)

.PHONY: ITG_PostScriptLib
all: ITG_PostScriptLib

ITG_PostScriptLib: $(call getPostScriptResourceOutputFiles)
ITG_PostScriptLib: $(ITG_POSTSCRIPTLIBFILES)
$(eval $(call pushArtifactTargets,ITG_POSTSCRIPTLIBFILES))
$(eval $(call pushArtifactTargets,ITG_POSTSCRIPTLIBDIR))

$(eval $(call definePostScriptTests,$(PSLIBFILES)))
$(eval $(call definePostScriptTests,$(ITG_POSTSCRIPTLIBFILES)))
Binary file modified ITG.PostScriptLib/ProcSet/graphics-alignments.ps
Binary file not shown.
Binary file modified ITG.PostScriptLib/ProcSet/graphics.ps
Binary file not shown.
Binary file modified ITG.PostScriptLib/ProcSet/roman.ps
Binary file not shown.
2 changes: 1 addition & 1 deletion encodings/New-PostscriptEncodingTable.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ function ConvertTo-PostScriptEncodingTable {
%%EndComments
%%BeginProlog
%/${Encoding}Encoding.ps /Encoding resourcestatus { pop pop } {
%/${Encoding}Encoding /Encoding resourcestatus { pop pop } {
%!PS-Adobe-3.0 Resource-Encoding
%%BeginResource: Encoding (${Encoding}Encoding)
/${Encoding}Encoding [
Expand Down
47 changes: 37 additions & 10 deletions stamps/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ include $(ITG_MAKEUTILS_DIR)tests.mk
include $(ITG_MAKEUTILS_DIR)ghostscript.mk
include $(ITG_MAKEUTILS_DIR)appveyor.mk

# postscript to PDF build system

PSRESOURCEOUTPUTDIR = $(AUXDIR)Resource/
PSRESOURCESOURCEDIR = Resource/
STAMPSRCDIR := $(SOURCESDIR)
STAMPSSOURCEFILES := $(wildcard $(STAMPSRCDIR)*.ps)

PSLIBDIR := $(ROOT_PROJECT_DIR)ITG.PostScriptLib/
STAMPLIBDIR := Resource/
GSINCDIR := $(GSINCDIR) $(PSLIBDIR) $(STAMPLIBDIR)
STAMPLIBDIR := $(PSRESOURCESOURCEDIR)
ENCODINGSDIR := $(STAMPLIBDIR)$(ENCODINGRESOURCEDIR)

ifeq ($(filter %clean,$(MAKECMDGOALS)),)
Expand All @@ -29,21 +28,49 @@ endif
maintainer-clean::
$(RMDIR) $(ENCODINGSDIR)

# TODO: заменить на файлы в $(PSRESOURCEOUTPUTDIR)
STAMPINCFILES := \
$(call getPostScriptResourceFiles,$(PSLIBDIR)) \
$(ITG_POSTSCRIPTLIBFILES) \
$(call getPostScriptResourceFiles,$(STAMPLIBDIR)) \
$(ENCODINGSDIR)CP1251Encoding.ps \
$(ENCODINGSDIR)CP1253Encoding.ps

STAMPFONTDIR := $(ROOT_PROJECT_DIR)fonts/
GSFONTDIR := $(GSFONTDIR) $(STAMPFONTDIR)
STAMPFONTFILES := $(wildcard $(STAMPFONTDIR)*.pt3)
#STAMPFONTDIR := $(ROOT_PROJECT_DIR)fonts/
# TODO: убрать вообще после отладки
GSFONTDIR := $(GSFONTDIR) $(shell cygpath -w $(abspath $(PSRESOURCEOUTPUTDIR)$(FONTRESOURCEDIR)))
# TODO: заменить на файлы в $(PSRESOURCEOUTPUTDIR)
#STAMPFONTFILES := $(wildcard $(STAMPFONTDIR)*.pt3)

# TODO: скопировать шрифты нужно
$(PSRESOURCEOUTPUTDIR): $(PSRESOURCEOUTPUTDIR)$(FONTRESOURCEDIR)

$(eval $(foreach f,$(STAMPFONTFILES),$(call copyfileto,$(PSRESOURCEOUTPUTDIR)$(FONTRESOURCEDIR),$f)))
$(PSRESOURCEOUTPUTDIR)$(FONTRESOURCEDIR): $(foreach f,$(STAMPFONTFILES),$(PSRESOURCEOUTPUTDIR)$(FONTRESOURCEDIR)$(notdir $f))

# TODO: скопировать локальную библиотеку нужно
$(eval $(call copyPostScriptResource))
$(PSRESOURCEOUTPUTDIR): $(call getPostScriptResourceOutputFiles)

# TODO: скопировать основную библиотеку нужно
#$(eval $(call copyPostScriptResource,$(ITG_POSTSCRIPTLIBFILES),$(ITG_POSTSCRIPTLIBDIR)))
$(eval $(foreach f,$(ITG_POSTSCRIPTLIBFILES),$(call copyfile,$(patsubst $(ITG_POSTSCRIPTLIBDIR)%,$(PSRESOURCEOUTPUTDIR)%,$f),$f)))
$(PSRESOURCEOUTPUTDIR): $(patsubst $(ITG_POSTSCRIPTLIBDIR)%,$(PSRESOURCEOUTPUTDIR)%,$(ITG_POSTSCRIPTLIBFILES))

#$(PSRESOURCEOUTPUTDIR): $(PSRESOURCEOUTPUTDIR)$(ENCODINGRESOURCEDIR)
#$(eval $(foreach f,$(STAMPFONTFILES),$(call copyfileto,$(PSRESOURCEOUTPUTDIR)$(FONTRESOURCEDIR),$f)))
#$(PSRESOURCEOUTPUTDIR)$(ENCODINGRESOURCEDIR): $(foreach f,$(STAMPFONTFILES),$(PSRESOURCEOUTPUTDIR)$(FONTRESOURCEDIR)$(notdir $f))



STAMPSPDFFILES := $(patsubst $(STAMPSRCDIR)%.ps,$(OUTPUTDIR)%.pdf,$(STAMPSSOURCEFILES))

$(STAMPSPDFFILES): $(STAMPINCFILES) $(STAMPFONTFILES)
# TODO: проверить зависимости
$(STAMPSPDFFILES): $(PSRESOURCEOUTPUTDIR)
#$(STAMPSPDFFILES): $(STAMPINCFILES) $(STAMPFONTFILES)

$(eval $(call definePostScriptBuildTests,$(STAMPINCFILES) $(STAMPFONTFILES)))
# TODO: проверить зависимости
#$(eval $(call definePostScriptBuildTests,$(STAMPINCFILES) $(STAMPFONTFILES)))
$(eval $(call definePostScriptBuildTests,$(PSRESOURCEOUTPUTDIR)))

.PHONY: pdf
pdf: $(STAMPSPDFFILES)
Expand Down
Binary file modified stamps/Resource/Encoding/CP1251Encoding.ps
Binary file not shown.
Binary file modified stamps/Resource/Encoding/CP1253Encoding.ps
Binary file not shown.
Binary file modified stamps/Resource/ProcSet/csm-marks-cyr-signs.ps
Binary file not shown.
Binary file modified stamps/Resource/ProcSet/csm-marks-greek-signs.ps
Binary file not shown.
Binary file modified stamps/Resource/ProcSet/csm-marks.ps
Binary file not shown.
Binary file modified stamps/Resource/ProcSet/distiller.ps
Binary file not shown.
Binary file modified stamps/Resource/ProcSet/image-rst.ps
Binary file not shown.
Binary file modified stamps/Resource/ProcSet/image-st.ps
Binary file not shown.
Binary file modified stamps/tests/4.1.ps
Binary file not shown.
Binary file modified stamps/tests/4.2.ps
Binary file not shown.
Binary file modified stamps/tests/4.3_4.4.ps
Binary file not shown.
Binary file modified stamps/tests/4.rhombus.ps
Binary file not shown.
Binary file modified stamps/tests/4.samples.ps
Binary file not shown.

0 comments on commit dc3e677

Please sign in to comment.