diff options
author | Dmitry Marakasov <amdmi3@FreeBSD.org> | 2013-12-24 03:30:22 +0000 |
---|---|---|
committer | Dmitry Marakasov <amdmi3@FreeBSD.org> | 2013-12-24 03:30:22 +0000 |
commit | d44cfe00eef48ab9f9f869d59b77a771cc0346bb (patch) | |
tree | 1ded4550046950b39fc0a85dedeed84b637acc3f /graphics | |
parent | 466df4baf5a653768259ea04641b1cfd44ad584c (diff) | |
download | ports-d44cfe00eef48ab9f9f869d59b77a771cc0346bb.tar.gz ports-d44cfe00eef48ab9f9f869d59b77a771cc0346bb.zip |
Notes
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/wings/Makefile | 3 | ||||
-rw-r--r-- | graphics/wings/files/patch-src_wings____font.erl | 76 | ||||
-rw-r--r-- | graphics/wings/files/patch-src_wings__text.erl | 73 |
3 files changed, 151 insertions, 1 deletions
diff --git a/graphics/wings/Makefile b/graphics/wings/Makefile index 9f52c630ebd3..349c10ea77af 100644 --- a/graphics/wings/Makefile +++ b/graphics/wings/Makefile @@ -3,7 +3,7 @@ PORTNAME= wings PORTVERSION= 1.4.1 -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= graphics MASTER_SITES= SF DIST_SUBDIR= erlang @@ -39,6 +39,7 @@ DESKTOP_ENTRIES="Wings" \ post-patch: @${REINPLACE_CMD} -e 's|$$(GCC)|${CC} -I${LOCALBASE}/include -L${LOCALBASE}/lib|g' \ ${WRKSRC}/plugins_src/accel/Makefile + @${FIND} ${WRKSRC} -name "*.orig" -delete do-install: ${MKDIR} ${STAGEDIR}${PREFIX}/lib/erlang/lib/${DISTNAME} diff --git a/graphics/wings/files/patch-src_wings____font.erl b/graphics/wings/files/patch-src_wings____font.erl new file mode 100644 index 000000000000..7c3815997078 --- /dev/null +++ b/graphics/wings/files/patch-src_wings____font.erl @@ -0,0 +1,76 @@ + +$FreeBSD$ + +--- src/wings__font.erl.orig ++++ src/wings__font.erl +@@ -11,45 +11,50 @@ + %% $Id$ + %% + +--module(wings__font, [Key,Desc,Width,Height,GlyphTab,Bitmaps]). +--export([key/0,desc/0,width/0,height/0,draw/1,char/1,char_width/1, +- bold_char/1,bold_char_width/1]). ++-module(wings__font). ++-export([new/6,key/1,desc/1,width/1,height/1,draw/2,char/2,char_width/2, ++ bold_char/2,bold_char_width/2]). + +-draw([C|T]) -> +- char(C), +- draw(T); +-draw([]) -> ok. ++-record(font, {key, desc, width, height, glyph_tab, bitmaps}). + +-key() -> Key. +-desc() -> Desc. ++new(Key, Desc, Width, Height, GlyphTab, Bitmaps) -> ++ #font{key = Key, desc = Desc, width = Width, height = Height, glyph_tab = GlyphTab, bitmaps = Bitmaps}. + +-char_width(C) -> +- element(1, glyph_info(C)). +-width() -> ++draw(Font, [C|T]) -> ++ char(Font, C), ++ draw(Font, T); ++draw(_Font, []) -> ok. ++ ++key(#font{key = Key}) -> Key. ++desc(#font{desc = Desc}) -> Desc. ++ ++char_width(Font, C) -> ++ element(1, glyph_info(Font, C)). ++width(#font{width = Width}) -> + insert_glyph(char_width, Width), + Width. +-height() -> ++height(#font{height = Height}) -> + insert_glyph(char_height, Height), + Height. + +-bold_char(C) -> +- Glyph = glyph_info(C), ++bold_char(Font, C) -> ++ Glyph = glyph_info(Font, C), + draw_glyph(Glyph), + Cw = glyph_width(Glyph), + gl:bitmap(1, 1, 0, 0, -Cw+1, 0, <<0>>), + draw_glyph(Glyph). + +-bold_char_width(C) -> +- Glyph = glyph_info(C), ++bold_char_width(Font, C) -> ++ Glyph = glyph_info(Font, C), + glyph_width(Glyph)+1. + +-char(C) -> +- draw_glyph(glyph_info(C)). ++char(Font, C) -> ++ draw_glyph(glyph_info(Font, C)). + + draw_glyph({W,H,Xorig,Yorig,Xmove,B}) -> + gl:bitmap(W, H, Xorig, Yorig, Xmove, 0, B). + +-glyph_info(C) -> ++glyph_info(#font{glyph_tab = GlyphTab, width = Width, height = Height, bitmaps = Bitmaps}, C) -> + BitMap = case ets:lookup(GlyphTab, C) of + [] when is_integer(C), C > 0 -> + %% Undefined character. Return a filled box. diff --git a/graphics/wings/files/patch-src_wings__text.erl b/graphics/wings/files/patch-src_wings__text.erl new file mode 100644 index 000000000000..6655ba3a5169 --- /dev/null +++ b/graphics/wings/files/patch-src_wings__text.erl @@ -0,0 +1,73 @@ + +$FreeBSD$ + +--- src/wings_text.erl.orig ++++ src/wings_text.erl +@@ -65,7 +65,7 @@ + + bold_string_width([C|S], W) -> + BCW = case wings_font_table:bold_char_width(C) of +- undefined -> (current_font()):bold_char_width(C); ++ undefined -> wings__font:bold_char_width(current_font(), C); + Other -> Other + end, + bold_string_width(S, BCW+W); +@@ -74,19 +74,19 @@ + + char_width(C) -> + case wings_font_table:char_width(C) of +- undefined -> (current_font()):char_width(C); ++ undefined -> wings__font:char_width(current_font(), C); + Other -> Other + end. + + width() -> + case wings_font_table:char(char_width) of +- undefined -> (current_font()):width(); ++ undefined -> wings__font:width(current_font()); + Other -> Other + end. + + height() -> + case wings_font_table:char(char_height) of +- undefined -> (current_font()):height(); ++ undefined -> wings__font:height(current_font()); + Other -> Other + end. + +@@ -111,13 +111,13 @@ + char(C) when is_atom(C) -> special(C); + char(C) -> + case wings_font_table:char(C) of +- undefined -> (current_font()):char(C); ++ undefined -> wings__font:char(current_font(), C); + Other -> Other + end. + + bold([C|S]) -> + case wings_font_table:bold_char(C) of +- undefined -> (current_font()):bold_char(C); ++ undefined -> wings__font:bold_char(current_font(), C); + Other -> Other + end, + bold(S); +@@ -195,7 +195,7 @@ + CharWidth = wings_text:width([$\s])*2, + Line = [$\s,$\s|Line0], + string_to_text_box(Tb#tb{text=Text,lw=LW+CharWidth,line=Line}); +- ++ + string_to_text_box(#tb{text=[{Style,String}=Stylized|Text],lw=Lw, max=Max, line=Line0,res=Res}=Tb0) -> + Sw = width([Stylized]), + NLW = Lw + Sw, +@@ -504,8 +504,8 @@ + {ok,Bin} = file:read_file(FontDir), + Font = binary_to_term(Bin), + Mod = load_font_1(Font), +- Key = Mod:key(), +- Desc = Mod:desc(), ++ Key = wings__font:key(Mod), ++ Desc = wings__font:desc(Mod), + ets:insert(wings_fonts, {Key,Mod,Desc}). + + load_font_1({wings_font,?wings_version,Font}) -> |