64 Commits

Author SHA1 Message Date
89fc7f863d Fixed API documentation (height replaced by top) 2019-03-14 09:48:27 +01:00
6162f49bc1 Replaced prints by minetest.log and code styling 2019-03-14 09:46:04 +01:00
0ca85ac5c1 Detect rotation restriction (#29)
Autodetect rotation restrictions if on MT<5.0
2019-03-14 09:36:41 +01:00
882af249e0 Fixed crash on MT0.4 2019-03-11 10:16:18 +01:00
1c15814156 Updated screenshot 2019-03-09 21:18:57 +01:00
76dde2b6f5 Fixed a remaining bug in node placement 2019-03-09 21:18:43 +01:00
7c4af47caf Update README 2019-03-09 20:50:48 +01:00
5d91a6de20 Update README 2019-03-09 20:47:33 +01:00
2e98900cc0 Use MT5 set_rotation to allow all rotations of nodes 2019-03-09 20:24:53 +01:00
b43c7046d7 Fixed top and bottom nodeboxes in preparation of new rotation abilities 2019-03-09 19:11:44 +01:00
2d63967938 Removed redundant mod dependancies 2019-03-09 19:10:27 +01:00
38e5d62caf Small update of README 2019-03-09 19:09:27 +01:00
8735de0fce Added mod.conf 2019-03-09 19:08:46 +01:00
46cb9d82dd Switched from deprecated functions setyaw and setpos to set_yaw and set_pos 2019-03-05 20:59:42 +01:00
eae85369ca Update README.md 2018-12-14 11:17:38 +01:00
199f9c7a13 Merge branch 'dev' for version 1.2.3 2018-12-14 11:13:37 +01:00
9194904b78 Update README.md 2018-12-14 11:13:24 +01:00
f1b92adb0f Fixed craft recipe for labels 2018-12-13 17:44:36 +01:00
fc40e54ed2 Update API documentation 2018-12-11 14:58:11 +01:00
c9329d3789 Added display entity yaw attribute 2018-12-11 14:57:42 +01:00
e75d6bc575 Updated font_api mod desctiption in headers 2018-12-11 12:01:16 +01:00
4604be9a8b Updated font_api mod desctiption in headers 2018-12-11 11:57:54 +01:00
523485df2b Add font_lib to deprecation notice 2018-12-11 11:57:05 +01:00
81e6dc89ae Added font_lib deprecation and corresponding notices in READMEs 2018-12-11 11:52:55 +01:00
d013809244 Merge branch 'dev' of http://github.com/pyrollo/display_modpack into dev 2018-12-11 11:41:20 +01:00
62c8de26b4 Better management of display_api integration 2018-12-11 11:41:03 +01:00
feb1b639ff Better management of invalid UTF strings 2018-12-11 11:26:50 +01:00
4e5ebedc17 Merge branch 'master' into dev 2018-12-09 17:24:46 +01:00
ffe113c62a Remove entity where display node not found 2018-12-08 19:27:08 +01:00
e94a1b21f6 Merge branch 'deprecation' 2018-12-05 16:11:24 +01:00
f46dd0a72e New Font:render method 2018-12-05 15:41:56 +01:00
b71d5a8f01 Fixed width fonts specific management 2018-12-05 11:42:36 +01:00
0f514c5c89 Fixed entity existence verification 2018-12-04 18:01:36 +01:00
4d8dec3b79 Updated API with new group 2018-12-04 17:59:52 +01:00
e46ece5ec6 Depreciation of old display groups and display_lib global + warnings 2018-12-03 16:27:08 +01:00
a3e0d36a68 Fixed issue showing "Unknown objects" instead of display on Raspberry Pi 2018-12-02 21:05:46 +01:00
6900077558 Update README.md 2018-12-02 21:04:01 +01:00
b88f67f015 Avoid crash if entity not defined. 2018-12-02 15:22:37 +01:00
bcc181cb15 Replaced core reference by usual minetest reference 2018-12-01 20:44:10 +01:00
03983f081e Atempt to fix "unknown object" issue + code rework 2018-11-29 14:27:36 +01:00
ba5b7aee52 Red and blue signs, node names tidy up 2018-11-26 21:05:58 +01:00
52eb47626a Update SVG files 2018-11-26 20:14:20 +01:00
1c51fa7723 Updated readme and screenshot for v1.2.1 2018-11-23 11:56:08 +01:00
0f8db34368 Font chooser form added 2018-11-23 11:35:42 +01:00
367e5026dd Fonts configurable in signs, posters and steles 2018-11-23 11:34:55 +01:00
59ae9fa4d1 Simplified signs formspec for release 2018-11-18 15:44:55 +01:00
db66553fbf Update poster.svg 2018-11-18 15:34:49 +01:00
1f8451567f Merge local and origin 'master' branches 2018-11-18 15:32:07 +01:00
4eb72f0c3f Moved compatibility functions to compatibility.lua 2018-11-18 15:31:53 +01:00
d9b10f6c3e Update depends.txt 2018-11-13 17:20:06 +01:00
a720c1ffd7 Typo fixing 2018-11-13 14:25:33 +01:00
1221cfcc4a Update README.md 2018-11-13 14:02:04 +01:00
3bb05ea6a6 Updated README.md with links and fonts 2018-11-13 13:58:27 +01:00
77c8b0a5ec Update README.md 2018-11-09 15:28:54 +01:00
9c5752f0d9 Update README.md 2018-11-09 15:28:28 +01:00
ab70424143 Update README.md 2018-11-09 15:28:07 +01:00
7a3f3bf875 Update README.md 2018-11-09 09:37:06 +01:00
377d5f2b8c Merge branch 'master' of https://github.com/pyrollo/display_modpack 2018-11-09 09:35:51 +01:00
61ea3b35f3 Add font_metro screenshot.png 2018-11-09 09:35:36 +01:00
b2119e7ec1 Update font license in README.md 2018-11-07 11:00:45 +01:00
5b841a9008 Update and rename LICENSE.txt to LGPL.txt 2018-11-07 10:59:43 +01:00
1d26bcd9f3 Create CC-BY-SA.txt 2018-11-07 10:58:20 +01:00
6827063fbd Create README.md 2018-11-07 10:56:09 +01:00
01ba1d47b1 Updated changelog 2018-11-01 18:56:59 +01:00
62 changed files with 2540 additions and 1751 deletions

109
README.md
View File

@ -1,100 +1,115 @@
# Display Modpack
Version 1.1.1
# Display Modpack
Version 1.3.1
This modpack provides mods with dynamic display. Mods are :
- **display_api**: A library for adding display entities to nodes;
- **font_api**: A library for displaying fonts on entities;
- **signs_api**: A library for the easy creation of signs;
- **[display_api](https://github.com/pyrollo/display_modpack/tree/master/display_api)**: A library for adding display entities to nodes;
- **[font_api](https://github.com/pyrollo/display_modpack/tree/master/font_api)**: A library for displaying fonts on entities;
- **[signs_api](https://github.com/pyrollo/display_modpack/tree/master/signs_api)**: A library for the easy creation of signs;
- **[font_metro](https://github.com/pyrollo/display_modpack/tree/master/font_metro)**: A font mod used as default font (includes uppercase, lowercase and accentuated latin letters, usual signs, cyrillic and greek letters)
- **boards**: A mod providing school boards;
- **ontime_clocks**: A mod providing clocks which display the ingame time;
- **signs**: A mod providing signs and direction signs displaying text;
- **signs_road**: A mod providing road signs displaying text;
- **steles**: A mod providing stone steles with text;
- **[boards](https://github.com/pyrollo/display_modpack/tree/master/boards)**: A mod providing school boards (includes *tiny cursive font*, a handwriting style font);
- **[ontime_clocks](https://github.com/pyrollo/display_modpack/tree/master/ontime_clocks)**: A mod providing clocks which display the ingame time;
- **[signs](https://github.com/pyrollo/display_modpack/tree/master/signs)**: A mod providing signs and direction signs displaying text;
- **[signs_road](https://github.com/pyrollo/display_modpack/tree/master/signs_road)**: A mod providing road signs displaying text;
- **[steles](https://github.com/pyrollo/display_modpack/tree/master/steles)**: A mod providing stone steles with text;
For more information, see the [forum topic](https://forum.minetest.net/viewtopic.php?t=19365) at the Minetest forums.
![Presentation image of Display_Modpack](screenshot.png)
## Extra fonts
*Metro* and *Tiny Cursive* fonts are provided in **Display Modpack** (in **font_metro** and **boards** mods) but you can add more fonts by installing font mods. Be aware that each font mod comes with numerous textures. This can result in slowing media downloading and/or client display.
Extra font mods can be found here:
* [OldWizard](https://github.com/pyrollo/font_oldwizard): An old style gothic font.
* [Botic](https://github.com/pyrollo/font_botic): A scifi style font.
## Deprecation notice (for modders)
### December 2018
Following objects are deprecated, shows a warning in log when used:
* `display_modpack_node` group (use `display_api` group instead);
* `display_lib_node` group (use `display_api` group instead);
* `display_lib` global table (use `display_api` global table instead);
* `font_lib` global table (use `font_api` global table instead);
These objects will be removed in the future.
## Changelog
### 2019-03-14 (Version 1.3.1)
- __dispay_api__: Display API now detects automatically whenr rotation restrictions have to be applied.
- __sign_api__: Screwdriver behavior changed. Now, left click rotates and changes direction.
### 2019-03-09 (Version 1.3)
- __display_api__: Display nodes can be rotated in every directions (if running Minetest 5 or above).
- __display_api__: New setting to restrict rotations to Minetest 0.4 abilities (restriction enabled by default).
- __sign_api__: Changed behavior of screwdriver if no rotation restriction.
### 2018-12-14 (Version 1.2.3)
- __display_api__: New `yaw` attributes, entities can now have different angles with node.
- __font_api__: New `Font:render` method for texture creation
- __font_api__: Specific management for fixed width font. Allows number of columns based texture width.
- __font_api__: Improve `display_api` integration into `font_api`. Display API fully optional. `font_api.on_display_update` defined only if `display_api` enabled.
- __font_api__: Improve management of invalid UTF strings (should not crash anymore)
- __font_api__: Deprecation of `font_lib`
- __signs__: Fixed craft recipe for labels
### 2018-12-02 (Version 1.2.2)
- Fixed a bug that prevented Display API from working on some systems (Raspberry Pi)
### 2018-11-01 (Version 1.2.1)
- Now font can be chosen per sign / stele
### 2018-11-01 (Version 1.2)
- Labels and woodend signs added.
- Fallback mechanism for missing chars (For example: "é" --> "e" --> "E").
- Several bug fixes by 12Me21 and naturefreshmilk.
### 2018-07-16 (Version 1.1.1)
- Boards mod added.
- Bug fix in default font chosing when multiple font registered.
- Bug fix in default font chosing when multiple font registered.
### 2018-07-13 (Version 1.1.0)
- Font API rework introducing Font class.
- Replaced default Epilepsy Font by Metro Font for licensing purposes,
- Rework of all nodes displaying text accordingly to the Font API rework.
As font_epilepsy mod has been replaced by font_metro mod, **don't forget to activate font_metro mod after updating** or you won't have any text displayed.
### 2018-05-30 (Version 1.0.1)
Mostly bug fixes :
- Fix steles orientation when placing
- Update entity on mapblock load
- Use default formspec style
- Fix ndef nill value in steles mod when technics not installed
- Seperate signs API from signs définitions
- Allow a greater offset between display and block
### 2018-01-13 (Version 1.0)
- Switch to Epilepsy font by KREATIVE SOFTWARE
- Add settings "default_font"
- Add horizontal alignment
- Add tool for creating font textures from .ttf font files
- Fix UTF 8 to Unicode decoding
- Fix UTF 8 to Unicode decoding
- Updated forum thread link in README.md
### 2017-12-19
This change is a preparation to merge Andrzej Pieńkowski fork (apienk) : new font and support of UTF chars.
- Font\_lib support for multiple fonts (nothing yet visible in mods) ;
- Font\_lib support for Unicode characters (limited to Unicode Plane 0: 0000-FFFF, see [Wikipedia](https://en.wikipedia.org/wiki/Unicode)) ;
- Font\_lib support for Unicode characters (limited to Unicode Plane 0: 0000-FFFF, see [Wikipedia](https://en.wikipedia.org/wiki/Unicode)) ;
- New "default" font with original textures from Vanessa Ezekowitz (VanessaE) ;
### 2017-12-10
- Compatibility of signs mod with signs_lib (thanks to gpcf) ;
- Added large banner in road signs (thanks to gpcf) ;
### 2017-08-26
- Changed signs from wallmounted to facedir to improve textures and make it possible to use screwdriver.
- Changed signs from wallmounted to facedir to improve textures and make it possible to use screwdriver.
**IMPORTANT** : Map will be updated to change to new nodes but inventory items will turn into "Unknown items" and have to be re-crafted.
- Intllib support added with french translation (whole modpack, thanks to fat115) ;
- Punch on nodes to update entity (signs, signs_road and steles). Usefull in case of /clearobjects ;
- Changed wooden direction sign textures (signs) ;
- Added back and side textures to all signs (road_signs) ;
- Added more sign types : White/yellow/green signs and direction signs (signs_road) ;

3
boards/mod.conf Normal file
View File

@ -0,0 +1,3 @@
name=boards
description=Writable school boards using sign_api
depends=default,signs_api

View File

@ -1,58 +1,56 @@
# Display Lib API
This document describes Display Lib API. Display Lib allows to add a dynamic display on a node. Display Lib limits node rotations. For wallmounted, only vertical positionning is available, and for facedir, only first four position are availabel (those with default axis).
# Display API
This document describes Display API. Display API allows to add a dynamic display on a node. Display API limits node rotations. For wallmounted, only vertical positionning is available. For facedir, only first four position are availabel (those with default axis).
## Provided methods
### update\_entities
**display\_lib.update\_entities(pos)**
**display\_api.update\_entities(pos)**
This method triggers entities update for the display node at pos. Actual entity update is made by `on_display_update` callback associated to the entity.
`pos`: Position of the node
### register\_display\_entity
**display\_lib.register\_display\_entity(entity_name)**
**display\_api.register\_display\_entity(entity_name)**
This is a helper to register entities used for display.
This is a helper to register entities used for display.
`entity_name`: Name of the entity to register.
## Provided callback implementations
### on_place
**display\_lib.on\_place(itemstack, placer, pointed\_thing)**
**display\_api.on\_place(itemstack, placer, pointed\_thing)**
`on_place` node callback implementation. Display nodes should have this callback (avoid placement of horizontal display node).
### on_construct
**display\_lib.on\_construct(pos)**
**display\_api.on\_construct(pos)**
`on_construct` node callback implementation. Display nodes should have this callback (creates, places and updates display entities on node construction).
### on_destruct
**display\_lib.on_destruct(pos)**
**display\_api.on_destruct(pos)**
`on_destruct` node callback implementation. Display nodes should have this callback (removes display entities on node destruction).
`on_destruct` node callback implementation. Display nodes should have this callback (removes display entities on node destruction).
### on_rotate
**display\_lib.on\_rotate(pos, node, user, mode, new_param2)**
**display\_api.on\_rotate(pos, node, user, mode, new_param2)**
`on_rotate` node callback implementation. Display nodes should have this callback (restricts rotations and rotates display entities associated with node).
### on_activate
**display\_lib.on_activate(entity, staticdata)**
**display\_api.on_activate(entity, staticdata)**
`On_activate` entity callback implementation for display entities. No need of this method if display entities have been registered using `register_display_entity` (callback is already set).
`On_activate` entity callback implementation for display entities. No need of this method if display entities have been registered using `register_display_entity` (callback is already set).
## Howto register a display node
* Register display entities with `register_display_entity`
* Register node with :
- `on_place`, `on_construct`, `on_destruct` and `on_rotate` callbacks using display_api callbacks.
 
- `display_modpack_node` group. This will make this node have their entities updated as soon as the mapblock is loaded (Useful after /clearobjects).
 
- a `display_entities` field in node definition containing a entity name indexed table. See below for description of each display_entities fields.
- `on_place`, `on_construct`, `on_destruct` and `on_rotate` callbacks using display_api callbacks.\
- `display_api` group. This will make this node have their entities updated as soon as the mapblock is loaded (Useful after /clearobjects).\
- a `display_entities` field in node definition containing a entity name indexed table. See below for description of each display_entities fields.\
### Display_entities fields
`on_display_update` is a callback in charge of setting up entity texture. If not set, entity will have no texture and will be displayed as unknown item.
`depth`, `right` and `height` : Entity position regarding to node facedir/wallmounted main axis.
Values for these fields can be any number between -1.5 and 1.5 (default value is 0).
Position 0,0,0 is the center of the node.
`depth` goes from front (-0.5) to rear (0.5), `height` goes from bottom (-0.5) to top (0.5) and `right` goes from left (-0.5) to right (0.5).
`on_display_update` is a callback in charge of setting up entity texture. If not set, entity will have no texture and will be displayed as unknown item.\
`depth`, `right` and `top`: Entity position regarding to node facedir/wallmounted main axis.\
Values for these fields can be any number between -1.5 and 1.5 (default value is 0). Position 0,0,0 is the center of the node.\
`depth` goes from front (-0.5) to rear (0.5), `top` goes from bottom (-0.5) to top (0.5) and `right` goes from left (-0.5) to right (0.5).\
`yaw`: Entity yaw in radians, regarding to main axis. Default is 0, aligned to node face.
In order to avoid flickering text, it's better to have text a little behind node surface. A good spacing value is given by `display_api.entity_spacing` variable.
@ -61,12 +59,12 @@ In order to avoid flickering text, it's better to have text a little behind node
display_api.register_display_entity("mymod:entity1")
display_api.register_display_entity("mymod:entity2")
function my_display_update1(pos, objref)
function my_display_update1(pos, objref)
objref:set_properties({ textures= {"mytexture1.png"},
visual_size = {x=1, y=1} })
end
function my_display_update2(pos, objref)
function my_display_update2(pos, objref)
objref:set_properties({ textures= {"mytexture2.png"},
                        visual_size = {x=1, y=1} })
end
@ -75,14 +73,14 @@ In order to avoid flickering text, it's better to have text a little behind node
...
paramtype2 = "facedir",
...
groups = { display_modpack_node = 1, ... },
groups = { display_api = 1, ... },
...
display_entities = {
["mymod:entity1"] = {
["mymod:entity1"] = {
depth = 0.3,
on_display_update = my_display_update1 },
["mymod:entity1"] = {
depth = 0.2, height = 0.1,
["mymod:entity1"] = {
depth = 0.2, top = 0.1,
on_display_update = my_display_update2 },
},
...

View File

@ -1,14 +1,34 @@
# Display Lib
# Display API
This library's purpose is to ease creation of nodes with one or more displays on sides. For example, signs and clocks. Display can be dynamic and/or different for each node instance.
**Limitations**: This lib uses entities to draw display. This means display has to be vertical. So display nodes rotation are limitated to "upside up" positions.
**Limitations**: This lib uses entities to draw display. This means display has to be vertical (and "upside up") on Minetest before version 5.0.
**Dependancies**:default
**License**: LPGL
**License**: LGPLv2
**API**: See [API.md](https://github.com/pyrollo/display_modpack/blob/master/display_api/API.md) document please.
For more information, see the [forum topic](https://forum.minetest.net/viewtopic.php?t=19365) at the Minetest forums.
## Deprecation notice (for modders)
### December 2018
Following objects are deprecated, shows a warning in log when used:
* `display_modpack_node` group (use `display_api` group instead);
* `display_lib_node` group (use `display_api` group instead);
* `display_lib` global table (use `display_api` global table instead);
These objects will be removed in the future.
## Change log
### 2019-03-14
- __dispay_api__: Display API now detects automatically whenr rotation restrictions have to be applied.
### 2019-03-09
- __display_api__: Display nodes can be rotated in every directions (if running Minetest 5 or above).
- __display_api__: New setting to restrict rotations to Minetest 0.4 abilities (restriction enabled by default).
### 2018-12-14
- __display_api__: New `yaw` attributes, entities can now have different angles with node.

View File

@ -0,0 +1,78 @@
--[[
display_api mod for Minetest - Library to add dynamic display
capabilities to nodes
(c) Pierre-Yves Rollo
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
--]]
-- Deprecation
function deprecated_group(deprecated_group, replacement_group)
for name, ndef in pairs(minetest.registered_nodes) do
if ndef.groups and ndef.groups[deprecated_group] then
minetest.log("warning", string.format(
'Node %s belongs to deprecated "%s" group which should be replaced with new "%s" group.',
name, deprecated_group, replacement_group))
end
end
end
function deprecated_global_table(deprecated_global_name, replacement_global_name)
assert(type(deprecated_global_name) == 'string', "deprecated_global_name should be a string.")
assert(type(replacement_global_name) == 'string', "replacement_global_name should be a string.")
assert(deprecated_global_name ~= '', "deprecated_global_name should not be empty.")
assert(replacement_global_name ~= '', "replacement_global_name should not be empty.")
assert(rawget(_G, deprecated_global_name) == nil, "deprecated global does not exist.")
if _G[replacement_global_name] == nil then
minetest.log('warning', string.format(
'Replacement global "%s" does not exists.', replacement_global_name))
return
end
local meta = {
deprecated = deprecated_global_name,
replacement = replacement_global_name,
__index = function(table, key)
local meta = getmetatable(table)
local dbg = debug.getinfo(2, "lS")
minetest.log("warning", string.format(
'Accessing deprecated "%s" table, "%s" should be used instead (%s:%d).',
meta.deprecated, meta.replacement, (dbg.short_src or 'unknown'),
(dbg.currentline or 0)))
return _G[meta.replacement][key]
end,
__newindex = function(table, key, value)
local meta = getmetatable(table)
local dbg = debug.getinfo(2, "lS")
minetest.log("warning", string.format(
'Accessing deprecated "%s" table, "%s" should be used instead (%s:%d).',
meta.deprecated, meta.replacement, (dbg.short_src or 'unknown'),
(dbg.currentline or 0)))
_G[meta.replacement][key]=value
end,
}
rawset(_G, deprecated_global_name, {})
setmetatable(_G[deprecated_global_name], meta)
end
-- deprecated(1) -- December 2018 - Deprecation of groups display_modpack_node and display_lib_node
-- Group to be removed from display API register_lbm
minetest.after(0, function()
deprecated_group("display_modpack_node", "display_api")
deprecated_group("display_lib_node", "display_api")
end)
-- deprecated(2) -- December 2018 - Deprecation of display_lib
deprecated_global_table('display_lib', 'display_api')

318
display_api/display.lua Normal file
View File

@ -0,0 +1,318 @@
--[[
display_api mod for Minetest - Library to add dynamic display
capabilities to nodes
(c) Pierre-Yves Rollo
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
--]]
-- Prefered gap between node and entity
-- Entity positionment is up to mods but it is a good practice to use this
-- variable as spacing between entity and node
display_api.entity_spacing = 0.002
-- Maximum entity position relative to the node pos
local max_entity_pos = 1.5
local wallmounted_rotations = {
[0]={x=1, y=0, z=0}, [1]={x=3, y=0, z=0},
[2]={x=0, y=3, z=0}, [3]={x=0, y=1, z=0},
[4]={x=0, y=0, z=0}, [5]={x=0, y=2, z=0},
}
local facedir_rotations = {
[ 0]={x=0, y=0, z=0}, [ 1]={x=0, y=3, z=0},
[ 2]={x=0, y=2, z=0}, [ 3]={x=0, y=1, z=0},
[ 4]={x=3, y=0, z=0}, [ 5]={x=0, y=3, z=3},
[ 6]={x=1, y=0, z=2}, [ 7]={x=0, y=1, z=1},
[ 8]={x=1, y=0, z=0}, [ 9]={x=0, y=3, z=1},
[10]={x=3, y=0, z=2}, [11]={x=0, y=1, z=3},
[12]={x=0, y=0, z=1}, [13]={x=3, y=0, z=1},
[14]={x=2, y=0, z=1}, [15]={x=1, y=0, z=1},
[16]={x=0, y=0, z=3}, [17]={x=1, y=0, z=3},
[18]={x=2, y=0, z=3}, [19]={x=3, y=0, z=3},
[20]={x=0, y=0, z=2}, [21]={x=0, y=1, z=2},
[22]={x=0, y=2, z=2}, [23]={x=0, y=3, z=2},
}
-- Compute other useful values depending on wallmounted and facedir param
local wallmounted_values = {}
local facedir_values = {}
local function compute_values(r)
local function rx(v) return { x=v.x, y=v.z, z=-v.y} end
local function ry(v) return { x=-v.z, y=v.y, z=v.x} end
local function rz(v) return { x=v.y, y=-v.x, z=v.z} end
local d = { x = 0, y = 0, z = 1 }
local w = { x = 1, y = 0, z = 0 }
local h = { x = 0, y = 1, z = 0 }
-- Important to keep z rotation first (not same results)
for _ = 1, r.z do d, w, h = rz(d), rz(w), rz(h) end
for _ = 1, r.x do d, w, h = rx(d), rx(w), rx(h) end
for _ = 1, r.y do d, w, h = ry(d), ry(w), ry(h) end
return {
rotation=r, depth=d, width=w, height=h,
restricted=(r.x==0 and r.z==0) }
end
for i, r in pairs(facedir_rotations) do
facedir_values[i] = compute_values(r)
end
for i, r in pairs(wallmounted_rotations) do
wallmounted_values[i] = compute_values(r)
end
-- Detect rotation restriction
local rotation_restricted = nil
minetest.register_entity('display_api:dummy_entity', {
collisionbox = { 0, 0, 0, 0, 0, 0 },
visual = "upright_sprite",
textures = {} })
function display_api.is_rotation_restricted()
if rotation_restricted == nil then
local objref = minetest.add_entity(
{x=0, y=0, z=0}, 'display_api:dummy_entity')
if objref then
rotation_restricted = objref.set_rotation == nil
objref:remove()
end
end
return rotation_restricted
end
-- Clip position property to maximum entity position
local function clip_pos_prop(posprop)
if posprop then
return math.max(-max_entity_pos, math.min(max_entity_pos, posprop))
else
return 0
end
end
-- Get values needed for orientation computation of node
local function get_orientation_values(node)
local ndef = minetest.registered_nodes[node.name]
if ndef then
local paramtype2 = ndef.paramtype2
if paramtype2 == "wallmounted" or paramtype2 == "colorwallmounted" then
return wallmounted_values[node.param2 % 8]
elseif paramtype2 == "facedir" or paramtype2 == "colorfacedir" then
return facedir_values[node.param2 % 32]
else
-- No orientation or unknown orientation type
return facedir_values[0]
end
end
end
-- Gets the display entities attached with a node.
-- Add missing and remove duplicates
local function get_display_objrefs(pos, create)
local objrefs = {}
local ndef = minetest.registered_nodes[minetest.get_node(pos).name]
if ndef and ndef.display_entities then
for _, objref in
ipairs(minetest.get_objects_inside_radius(pos, max_entity_pos)) do
local entity = objref:get_luaentity()
if entity and ndef.display_entities[entity.name] and
entity.nodepos and vector.equals(pos, entity.nodepos) then
if objrefs[entity.name] then
objref:remove() -- Remove duplicates
else
objrefs[entity.name] = objref
end
end
end
if create then
-- Add missing
for name, _ in pairs(ndef.display_entities) do
if not objrefs[name] then
objrefs[name] = minetest.add_entity(pos, name,
minetest.serialize({ nodepos = pos }))
end
end
end
end
return objrefs
end
--- Force entity update : position and texture
function display_api.update_entities(pos)
local node = minetest.get_node(pos)
local ndef = minetest.registered_nodes[node.name]
local ov = get_orientation_values(node)
for _, objref in pairs(get_display_objrefs(pos, true)) do
local edef = ndef.display_entities[objref:get_luaentity().name]
local depth = clip_pos_prop(edef.depth)
local right = clip_pos_prop(edef.right)
local top = clip_pos_prop(edef.top)
objref:set_pos({
x = pos.x + ov.depth.x*depth + ov.width.x*right - ov.height.x*top,
y = pos.y + ov.depth.y*depth + ov.width.y*right - ov.height.y*top,
z = pos.z + ov.depth.z*depth + ov.width.z*right - ov.height.z*top,
})
if objref.set_rotation then
objref:set_rotation({
x = ov.rotation.x*math.pi/2,
y = ov.rotation.y*math.pi/2 + (edef.yaw or 0),
z = ov.rotation.z*math.pi/2,
})
else
if ov.rotation.x ~=0 or ov.rotation.y ~= 0 then
minetest.log("warning", string.format(
"[display_api] unable to rotate correctly entity for node at %s without set_rotation method.",
minetest.pos_to_string(pos)))
end
objref:set_yaw(ov.rotation.y*math.pi/2 + (edef.yaw or 0))
end
-- Call on_display_update callback of a node for one of its display entities
if edef.on_display_update then
edef.on_display_update(pos, objref)
end
end
end
--- On_activate callback for display_api entities. Calls on_display_update callbacks
--- of corresponding node for each entity.
function display_api.on_activate(entity, staticdata)
if entity then
if string.sub(staticdata, 1, string.len("return")) == "return" then
local data = minetest.deserialize(staticdata)
if data and type(data) == "table" then
entity.nodepos = data.nodepos
end
entity.object:set_armor_groups({immortal=1})
end
if entity.nodepos then
local node = minetest.get_node(entity.nodepos)
local ndef = minetest.registered_nodes[node.name]
if ndef and ndef.display_entities then
local edef = ndef.display_entities[entity.name]
if edef then
-- Call on_display_update callback of the entity to build texture
if edef.on_display_update then
edef.on_display_update(entity.nodepos, entity.object)
end
return
end
end
end
-- If we got here, this display entity is buggy and should be removed
entity.object:remove()
end
end
--- On_place callback for display_api items.
-- Does nothing more than preventing node from being placed on ceiling or ground
-- TODO:When MT<5 is not in use anymore, simplify this
function display_api.on_place(itemstack, placer, pointed_thing, override_param2)
local ndef = itemstack:get_definition()
local dir = {
x = pointed_thing.under.x - pointed_thing.above.x,
y = pointed_thing.under.y - pointed_thing.above.y,
z = pointed_thing.under.z - pointed_thing.above.z,
}
local rotation_restriction = display_api.is_rotation_restricted()
if rotation_restriction then
-- If item is not placed on a wall, use the player's view direction instead
if dir.x == 0 and dir.z == 0 then
dir = placer:get_look_dir()
end
dir.y = 0
end
local param2 = 0
if ndef then
if ndef.paramtype2 == "wallmounted" or
ndef.paramtype2 == "colorwallmounted" then
param2 = minetest.dir_to_wallmounted(dir)
elseif ndef.paramtype2 == "facedir" or
ndef.paramtype2 == "colorfacedir" then
param2 = minetest.dir_to_facedir(dir, not rotation_restriction)
end
end
return minetest.item_place(itemstack, placer, pointed_thing,
param2 + (override_param2 or 0))
end
--- On_construct callback for display_api items.
-- Creates entities and update them.
function display_api.on_construct(pos)
display_api.update_entities(pos)
end
--- On_destruct callback for display_api items.
-- Removes entities.
function display_api.on_destruct(pos)
for _, objref in pairs(get_display_objrefs(pos)) do
objref:remove()
end
end
-- On_rotate (screwdriver) callback for display_api items. Prevents invalid
-- rotations and reorients entities.
function display_api.on_rotate(pos, node, user, _, new_param2)
node.param2 = new_param2
local ov = get_orientation_values(node)
if ov.restricted or not display_api.is_rotation_restricted() then
minetest.swap_node(pos, node)
display_api.update_entities(pos)
return true
else
return false
end
end
--- Creates display entity with some fields and the on_activate callback
function display_api.register_display_entity(entity_name)
if not minetest.registered_entities[entity_name] then
minetest.register_entity(':'..entity_name, {
collisionbox = { 0, 0, 0, 0, 0, 0 },
visual = "upright_sprite",
textures = {},
on_activate = display_api.on_activate,
get_staticdata = function(self)
return minetest.serialize({ nodepos = self.nodepos })
end,
})
end
end
minetest.register_lbm({
label = "Update display_api entities",
name = "display_api:update_entities",
run_at_every_load = true,
nodenames = {"group:display_api",
"group:display_modpack_node", "group:display_lib_node"}, -- See deprecated(1)
action = function(pos, node) display_api.update_entities(pos) end,
})

View File

@ -1,242 +1,31 @@
--[[
display_api mod for Minetest - Library to add dynamic display
capabilities to nodes
(c) Pierre-Yves Rollo
display_api mod for Minetest - Library to add dynamic display
capabilities to nodes
(c) Pierre-Yves Rollo
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
--]]
-- Global variables
-------------------
display_api = {}
display_api.name = minetest.get_current_modname()
display_api.path = minetest.get_modpath(display_api.name)
-- Prefered gap between node and entity
-- Entity positionment is up to mods but it is a good practice to use this
-- variable as spacing between entity and node
display_api.entity_spacing = 0.002
-- Inclusions
-------------
-- Miscelaneous values depending on wallmounted param2
local wallmounted_values = {
[2]={dx=-1, dz=0, rx=0, rz=-1, yaw=-math.pi/2},
[3]={dx=1, dz=0, rx=0, rz=1, yaw=math.pi/2 },
[4]={dx=0, dz=-1, rx=1, rz=0, yaw=0 },
[5]={dx=0, dz=1, rx=-1, rz=0, yaw=math.pi }
}
-- Miscelaneous values depending on facedir param2
local facedir_values = {
[0]={dx=0, dz=-1, rx=1, rz=0, yaw=0 },
[1]={dx=-1, dz=0, rx=0, rz=-1, yaw=-math.pi/2},
[2]={dx=0, dz=1, rx=-1, rz=0, yaw=math.pi },
[3]={dx=1, dz=0, rx=0, rz=1, yaw=math.pi/2 }
}
-- dx/dy = depth vector, rx/ly = right vector, yaw = yaw of entity,
local function get_values(node)
local ndef = minetest.registered_nodes[node.name]
if ndef then
local paramtype2 = ndef.paramtype2
if paramtype2 == "wallmounted" or paramtype2 == "colorwallmounted" then
return wallmounted_values[node.param2 % 8]
elseif paramtype2 == "facedir" or paramtype2 == "colorfacedir" then
return facedir_values[node.param2 % 32]
end
end
end
--- Checks if the object is related to the given position
local function check_entity_pos(pos, objref)
local real_pos = vector.round(objref:get_pos())
local pos_hash = objref:get_luaentity().pos
if pos_hash == nil then
return vector.equals(real_pos, vector.round(pos))
else
return vector.equals(minetest.get_position_from_hash(pos_hash), pos)
end
end
--- Gets the display entities attached with a node. Removes extra ones
local function get_entities(pos)
local objrefs = {}
local ndef = minetest.registered_nodes[minetest.get_node(pos).name]
if ndef and ndef.display_entities then
for _, objref in ipairs(minetest.get_objects_inside_radius(pos, 1.5)) do
local entity = objref:get_luaentity()
if entity and ndef.display_entities[entity.name] and check_entity_pos(pos, objref) then
if objrefs[entity.name] then
objref:remove()
else
objrefs[entity.name] = objref
end
end
end
end
return objrefs
end
local function clip_pos_prop(posprop)
if posprop then
return math.max(-1.5, math.min(1.5, posprop))
else
return 0
end
end
--- (Create and) place display entities according to the node orientation
local function place_entities(pos)
local node = minetest.get_node(pos)
local ndef = minetest.registered_nodes[node.name]
local values = get_values(node)
local objrefs = get_entities(pos)
if values and ndef and ndef.display_entities then
for entity_name, props in pairs(ndef.display_entities) do
local depth = clip_pos_prop(props.depth)
local right = clip_pos_prop(props.right)
local top = clip_pos_prop(props.top)
if not objrefs[entity_name] then
objrefs[entity_name] = minetest.add_entity(pos, entity_name)
end
objrefs[entity_name]:setpos({
x = pos.x - values.dx * depth + values.rx * right,
y = pos.y - top,
z = pos.z - values.dz * depth + values.rz * right})
objrefs[entity_name]:setyaw(values.yaw)
end
end
return objrefs
end
--- Call on_display_update callback of a node for one of its display entities
local function call_node_on_display_update(pos, objref)
local ndef = minetest.registered_nodes[minetest.get_node(pos).name]
local entity = objref:get_luaentity()
if ndef and ndef.display_entities and entity and ndef.display_entities[entity.name] then
ndef.display_entities[entity.name].on_display_update(pos, objref)
end
end
--- Force entity update
function display_api.update_entities(pos)
local objrefs = place_entities(pos)
for _, objref in pairs(objrefs) do
objref:get_luaentity().pos = minetest.hash_node_position(pos)
call_node_on_display_update(pos, objref)
end
end
--- On_activate callback for display_api entities. Calls on_display_update callbacks
--- of corresponding node for each entity.
function display_api.on_activate(entity, staticdata)
if entity then
if string.sub(staticdata, 1, string.len("return")) == "return" then
local data = core.deserialize(staticdata)
if data and type(data) == "table" then
entity.pos = data.pos
end
end
entity.object:set_armor_groups({immortal=1})
local pos
if entity.pos then
pos = minetest.get_position_from_hash(entity.pos)
else
pos = entity.object:getpos()
end
display_api.update_entities(pos)
end
end
--- On_place callback for display_api items. Does nothing more than preventing item
--- from being placed on ceiling or ground
function display_api.on_place(itemstack, placer, pointed_thing, override_param2)
local ndef = itemstack:get_definition()
local above = pointed_thing.above
local under = pointed_thing.under
local dir = {x = under.x - above.x,
y = 0,
z = under.z - above.z}
-- If item is not placed on a wall, use the player's view direction instead
if dir.x == 0 and dir.z == 0 then
dir = placer:get_look_dir()
dir.y = 0
end
local param2 = 0
if ndef then
local paramtype2 = ndef.paramtype2
if paramtype2 == "wallmounted" or paramtype2 == "colorwallmounted" then
param2 = minetest.dir_to_wallmounted(dir)
elseif paramtype2 == "facedir" or paramtype2 == "colorfacedir" then
param2 = minetest.dir_to_facedir(dir)
end
end
return minetest.item_place(itemstack, placer, pointed_thing, param2 + (override_param2 or 0))
end
--- On_construct callback for display_api items. Creates entities and update them.
function display_api.on_construct(pos)
display_api.update_entities(pos)
end
--- On_destruct callback for display_api items. Removes entities.
function display_api.on_destruct(pos)
local objrefs = get_entities(pos)
for _, objref in pairs(objrefs) do
objref:remove()
end
end
-- On_rotate (screwdriver) callback for display_api items. Prevents invalid rotations and reorients entities.
function display_api.on_rotate(pos, node, user, _, new_param2)
node.param2 = new_param2
if get_values(node) then
minetest.swap_node(pos, node)
place_entities(pos)
return true
else
return false
end
end
--- Creates display entity with some fields and the on_activate callback
function display_api.register_display_entity(entity_name)
if not minetest.registered_entity then
minetest.register_entity(':'..entity_name, {
collisionbox = { 0, 0, 0, 0, 0, 0 },
visual = "upright_sprite",
textures = {},
on_activate = display_api.on_activate,
get_staticdata = function(self)
return minetest.serialize({
pos = self.pos,
})
end,
})
end
end
minetest.register_lbm({
label = "Update display_api entities",
name = "display_api:update_entities",
run_at_every_load = true,
nodenames = {"group:display_modpack_node", "group:display_lib_node"},
action = function(pos, node) display_api.update_entities(pos) end,
})
-- Compatibility
display_lib = display_api
dofile(display_api.path.."/display.lua")
dofile(display_api.path.."/deprecation.lua")

2
display_api/mod.conf Normal file
View File

@ -0,0 +1,2 @@
name=display_api
description=A library for adding dynamic textures on nodes

View File

@ -1,5 +1,5 @@
# Font Lib API
This document describes Font Lib API. Font Lib creates textures for font display on entities.
# Font API
This document describes Font API. Font API creates textures for font display on entities.
## Settings
### default_font
@ -7,35 +7,114 @@ Name of the font to be used when no font is given. The font should be registered
If no default\_font given or if default\_font given but not registered, the first registered font will be used as default.
## Provided methods
## Use font_api with display_api (to display text on nodes)
### Base setup
Font_api offers a direct integration with display_api to display text on nodes.
First of all, create a display node with an entity.
To do this, refer to API.md in display_api mod, in particular "Howto register a display node".
The only requirement then is to connect the `on_display_update` callback of the display entity to `font_api.on_display_update`:
```
minetest.register_node("mymod:test_text_node", {
...
paramtype2 = "facedir",
...
groups = { display_api = 1, ... },
...
display_entities = {
["mymod:text"] = {
depth = -0.5 - display_api.entity_spacing,
on_display_update = font_api.on_display_update },
}
...
on_place = display_api.on_place,
on_construct = display_api.on_construct,
on_destruct = display_api.on_destruct,
on_rotate = display_api.on_rotate,
...
})
```
At this step, your node already displays text form "display_text" (by default) node meta. If you want to store your text into another meta data field, add a `meta_text` field to display entity definition.
But it uses defaults (default font, default size, default color). Likely you need something more.
### Style your text
Font style and size can be chosen by adding some more entries to the display_entities definition table.
#### Font size
Font size can be defined in various ways (maybe more in the future).
Start with a number of lines, and font_api will make it fit to the entity size.
* `maxlines` or `lines`: Number of maximum lines of text to be displayed. The font height will be adjusted accordingly.
Then specify the char width. Two methods available:
* `aspect_ratio`: Defines the aspect ratio of chars. Works with all fonts. Should not be used if `columns` is specified.
* `columns`: Only if using a fixed width font, specifies the number of columns to display.
#### Font style
* `font_name`: name of the font to use. Should correspond to a registered font (from a font mod). If not specified or font not found, default font is used.
* `color`: color to be used (default black).
* `halign`: Horizontal alignment: "left", "center" or "right" (default "center").
* `valign`: Vertical alignement: "top", "middle" or "bottom" (default "middle").
### Example
Using blue //botic// font, three lines height, aligned top left. Text stored in "text" node meta.
```
minetest.register_node("mymod:test_text_node", {
...
...
display_entities = {
["mymod:text"] = {
depth = -0.5 - display_api.entity_spacing,
on_display_update = font_api.on_display_update
meta_text = "text",
font_name = "botic",
color = "#0000FF",
maxlines = 3,
aspect_ratio = 0.5,
halign = "left",
valign = "top",
},
}
...
})
```
## Provided methods
### font_api.get_default_font_name()
Returns de default font name.
### font_api.register_font(font_name, font_def)
Register a new font.
**font_name**: Name of the font to register. If registering different sizes of the same font, add size in the font name (e.g. times_10, times_12...).
**font_def**: Font definition table (see **Font definition table** below).
* `font_name`: Name of the font to register. If registering different sizes of the same font, add size in the font name (e.g. times_10, times_12...).
* `font_def`: Font definition table (see **Font definition table** below).
### font_api.on_display_update(pos, objref)
Standard on_display_update entity callback.
**pos**: Node position
**objref**: Object reference of entity
* `pos`: Node position
* `objref`: Object reference of entity
Node should have a corresponding display_entity with size, resolution and maxlines fields and optionally halign, valign and color fields.
### Font definition table
## Font definition table
Font definition table used by **font_api.register_font** and **font\_api.Font:new** may/can contain following elements:
* **height** (required): Font height in pixels (all font textures should have the same height) .
* **widths** (required): Array of character widths in pixels, indexed by UTF codepoints.
* **margintop** (optional): Margin (in texture pixels) added on top of each char texture.
* **marginbottom** (optional): Margin (in texture pixels) added at bottom of each char texture.
* **linespacing** (optional): Spacing (in texture pixels) between each lines.
* `height` (required): Font height in pixels (all font textures should have the same height) .
* `widths` (required): Array of character widths in pixels, indexed by UTF codepoints.
* `margintop` (optional): Margin (in texture pixels) added on top of each char texture.
* `marginbottom` (optional): Margin (in texture pixels) added at bottom of each char texture.
* `linespacing` (optional): Spacing (in texture pixels) between each lines.
**margintop**, **marginbottom** and **linespacing** can be negative numbers (default 0) and are to be used to adjust various font styles to each other.
`margintop`, `marginbottom` and `linespacing` can be negative numbers (default 0) and are to be used to adjust various font styles to each other.
Font attributes around a single char:\
![Font attributes on a char](doc/font.svg)
Font attributes effects on several lines:\
![Font attributes on lines](doc/lines.svg)
#### Additional requirements
Font must have a char 0 which will be used to display any unknown char.
@ -57,7 +136,7 @@ Still in early stage of development, these tools are helpers to create font mods
### make_font_texture.sh
This scripts takes a .ttf file as input and create one .png file per char, that can be used as font texture. Launch it from your future font mod directory.
This scripts takes a .ttf file as input and create one .png file per char, that can be used as font texture. Launch it from your future font mod directory.
__Advice__
@ -95,51 +174,28 @@ __Syntax__
A font usable with font API. This class is supposed to be for internal use but who knows.
### font\_api.Font:new(def)
Create a new font object.
Create a new font object.
* `def` is a table containing font definition. See **Font definition table** above.
**def** is a table containing font definition. See **Font definition table** above.
### font:get_char_width(char)
Returns the width of char **char** in texture pixels.
**char**: Unicode codepoint of char.
### font:get_char_width(codepoint)
Returns the width of char `codepoint` in texture pixels.
* `codepoint`: Unicode codepoint of char.
### font:get_height(nb_of_lines)
Returns line(s) height. Takes care of top and bottom margins and line spacing.
**nb_of_lines**: Number of lines in the text.
* `nb_of_lines`: Number of lines in the text.
### font:get_width(line)
Returns the width of a text line. Beware, if line contains any new line char, they are ignored.
* `line`: Line of text which the width will be computed.
**line**: Line of text which the width will be computed.
### font:make_line_texture(line, texturew, x, y)
Create a texture for a text line.
**line**: Line of text to be rendered in texture.
**texturew**: Width of the texture (extra text is not rendered).
**x**: Starting x position in texture.
**y**: Vertical position of the line in texture.
### font:make_text_texture(text, texturew, textureh, maxlines, halign, valign, color)
### font:renter(text, texturew, textureh, style)
Builds texture for a multiline colored text.
**text**: Text to be rendered.
**texturew**: Width of the texture (extra text will be truncated).
**textureh**: Height of the texture.
**maxlines**: Maximum number of lines.
**halign**: Horizontal text align ("left"/"center"/"right") (optional).
**valign**: Vertical text align ("top"/"center"/"bottom") (optional).
**color**: Color of the text (optional).
* `text`: Text to be rendered.
* `texturew`: Width of the texture (extra text will be truncated).
* `textureh`: Height of the texture (extra text will be truncated).
* `style`: A table with style indications:
- `lines` or `maxlines`: Maximum number of lines (default none).
- `halign`: Horizontal text align: "left"/"center"/"right" (default "center")
- `valign`: Vertical text align: "top"/"middle"/"bottom" (default "middle")
- `color`: Color of the text (default black)

View File

@ -1,6 +1,6 @@
# Font Lib
# Font API
This library for font display on entities (to be used with display_api for sign creation).
A library for rendernig text on textures (to be used with display_api for sign creation).
**Dependancies**: default
@ -12,3 +12,20 @@ This library for font display on entities (to be used with display_api for sign
For more information, see the [forum topic](https://forum.minetest.net/viewtopic.php?t=13563) at the Minetest forums.
## Extra fonts
You can add fonts by installing fonts mod. Be aware that each font comes with numerous textures. This can result in slowing media downloading and/or client display.
Font mods can be found here:
* [Metro](https://github.com/pyrollo/display_modpack/tree/master/font_metro): A multipurpose font with many chars (uppercase, lowercase and accentuated latin letters, usual signs, cyrillic and greek letters).
* [OldWizard](https://github.com/pyrollo/font_oldwizard): An old style gothic font.
* [Botic](https://github.com/pyrollo/font_botic): A scifi style font.
## Deprecation notice (for modders)
### December 2018
Following object is deprecate, shows a warning in log when used:
* `font_lib` global table (use `font_api` global table instead);
This object will be removed in the future.

View File

@ -0,0 +1 @@
display_api?

59
font_api/deprecation.lua Normal file
View File

@ -0,0 +1,59 @@
--[[
font_api mod for Minetest - Library creating textures with fonts and text
(c) Pierre-Yves Rollo
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
--]]
-- Deprecation
function deprecated_global_table(deprecated_global_name, replacement_global_name)
assert(type(deprecated_global_name) == 'string', "deprecated_global_name should be a string.")
assert(type(replacement_global_name) == 'string', "replacement_global_name should be a string.")
assert(deprecated_global_name ~= '', "deprecated_global_name should not be empty.")
assert(replacement_global_name ~= '', "replacement_global_name should not be empty.")
assert(rawget(_G, deprecated_global_name) == nil, "deprecated global does not exist.")
if _G[replacement_global_name] == nil then
minetest.log('warning', string.format(
'Replacement global "%s" does not exists.', replacement_global_name))
return
end
local meta = {
deprecated = deprecated_global_name,
replacement = replacement_global_name,
__index = function(table, key)
local meta = getmetatable(table)
local dbg = debug.getinfo(2, "lS")
minetest.log("warning", string.format(
'Accessing deprecated "%s" table, "%s" should be used instead (%s:%d).',
meta.deprecated, meta.replacement, (dbg.short_src or 'unknown'),
(dbg.currentline or 0)))
return _G[meta.replacement][key]
end,
__newindex = function(table, key, value)
local meta = getmetatable(table)
local dbg = debug.getinfo(2, "lS")
minetest.log("warning", string.format(
'Accessing deprecated "%s" table, "%s" should be used instead (%s:%d).',
meta.deprecated, meta.replacement, (dbg.short_src or 'unknown'),
(dbg.currentline or 0)))
_G[meta.replacement][key]=value
end,
}
rawset(_G, deprecated_global_name, {})
setmetatable(_G[deprecated_global_name], meta)
end
-- deprecated(2) -- December 2018 - Deprecation of font_lib
deprecated_global_table('font_lib', 'font_api')

76
font_api/display_api.lua Normal file
View File

@ -0,0 +1,76 @@
--[[
font_api mod for Minetest - Library creating textures with fonts and text
(c) Pierre-Yves Rollo
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
--]]
-- Integration with display API
if minetest.get_modpath("display_api") then
--- Standard on_display_update entity callback.
-- Node should have properly configured display_entity.
-- @param pos Node position
-- @param objref Object reference of entity
font_api.on_display_update = function (pos, objref)
local meta = minetest.get_meta(pos)
local ndef = minetest.registered_nodes[minetest.get_node(pos).name]
local entity = objref:get_luaentity()
if not entity or not ndef.display_entities[entity.name] then
return
end
local def = ndef.display_entities[entity.name]
local font = font_api.get_font(meta:get_string("font") ~= ""
and meta:get_string("font") or def.font_name)
local text = meta:get_string(def.meta_text or "display_text")
-- Compute entity resolution accroding to given attributes
local texturew, textureh
textureh = font:get_height(def.lines or def.maxlines or 1)
if def.columns then
if font.fixedwidth then
texturew = def.columns * font.fixedwidth
if def.aspect_ratio then
minetest.log('warning', "[font_api] 'aspect_ratio' ignored because 'columns' is specified")
end
else
minetest.log('warning', "[font_api] 'columns' ignored because '"..font.name.."' is not a fixed width font.")
end
end
if not texturew then
if not def.aspect_ratio then
minetest.log('warning', "[font_api] No 'aspect_ratio' specified, using default 1.")
end
texturew = textureh * def.size.x / def.size.y / (def.aspect_ratio or 1)
end
objref:set_properties({
textures={ font:render(text, texturew, textureh, {
lines = def.maxlines or def.lines,
halign = def.halign,
valign = def.valign,
color = def.color} ) },
visual_size = def.size,
})
end
else
font_api.on_display_update = function (pos, objref)
minetest.log('error', '[font_api] font_api.on_display_update called but display_api mod not enabled.')
end
end

View File

@ -1,20 +1,19 @@
--[[
font_api mod for Minetest - Library to add font display capability
to display_api mod.
(c) Pierre-Yves Rollo
font_api mod for Minetest - Library creating textures with fonts and text
(c) Pierre-Yves Rollo
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
--]]
-- This is the unicode char fallback map. If a char is not present in

View File

@ -1,20 +1,19 @@
--[[
font_api mod for Minetest - Library to add font display capability
to display_api mod.
(c) Pierre-Yves Rollo
font_api mod for Minetest - Library creating textures with fonts and text
(c) Pierre-Yves Rollo
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
--]]
-- Fallback table
@ -39,14 +38,15 @@ local function char_to_codepoint(str)
local bytes = get_char_bytes(str)
if bytes == 1 then
return str:byte(1)
elseif bytes == 2 then
elseif bytes == 2 and str:byte(2) ~= nil then
return (str:byte(1) - 0xC2) * 0x40
+ str:byte(2)
elseif bytes == 3 then
elseif bytes == 3 and str:byte(2) ~= nil and str:byte(3) ~= nil then
return (str:byte(1) - 0xE0) * 0x1000
+ str:byte(2) % 0x40 * 0x40
+ str:byte(3) % 0x40
elseif bytes == 4 then -- Not tested
elseif bytes == 4 and str:byte(2) ~= nil and str:byte(3) ~= nil
and str:byte(4) ~= nil then -- Not tested
return (str:byte(1) - 0xF0) * 0x40000
+ str:byte(2) % 0x40 * 0x1000
+ str:byte(3) % 0x40 * 0x40
@ -54,20 +54,6 @@ local function char_to_codepoint(str)
end
end
-- Split multiline text into array of lines, with <maxlines> maximum lines.
-- Can not use minetest string.split as it has bug if first line(s) empty
local function split_lines(text, maxlines)
local lines = {}
local pos = 1
repeat
local found = string.find(text, "\n", pos)
found = found or #text + 1
lines[#lines + 1] = string.sub(text, pos, found - 1)
pos = found + 1
until (maxlines and (#lines >= maxlines)) or (pos > (#text + 1))
return lines
end
--------------------------------------------------------------------------------
--- Font class
@ -103,6 +89,16 @@ function Font:new(def)
local font = table.copy(def)
setmetatable(font, self)
self.__index = self
-- Check if fixedwidth
for codepoint, width in pairs(font.widths) do
font.fixedwidth = font.fixedwidth or width
if width ~= font.fixedwidth then
font.fixedwidth = nil
break
end
end
return font
end
@ -121,6 +117,12 @@ function Font:get_next_char(text)
local codepoint = char_to_codepoint(text)
if codepoint == nil then
minetest.log("warning",
"[font_api] Encountered a non UTF char, not displaying text.")
return nil, ''
end
-- Fallback mechanism
if self.widths[codepoint] == nil then
local char = text:sub(1, bytes)
@ -138,11 +140,11 @@ end
--- Returns the width of a given char
-- @param char : codepoint of the char
-- @return Char width
function Font:get_char_width(char)
-- Replace chars with no texture by the NULL(0) char
if self.widths[char] ~= nil then
return self.widths[char]
function Font:get_char_width(codepoint)
if self.fixedwidth then
return self.fixedwidth
elseif self.widths[codepoint] then
return self.widths[codepoint]
else
return self.widths[0]
end
@ -179,94 +181,94 @@ function Font:get_width(line)
while line ~= "" do
codepoint, line = self:get_next_char(line)
if codepoint == nil then return 0 end -- UTF Error
width = width + self:get_char_width(codepoint)
end
return width
end
--- Builds texture part for a text line
-- @param line Text line to be rendered
-- @param texturew Width of the texture (extra text is not rendered)
-- @param x Starting x position in texture
-- @param y Vertical position of the line in texture
-- @return Texture string
function Font:make_line_texture(line, texturew, x, y)
local codepoint
local texture = ""
line = line or ''
while line ~= '' do
codepoint, line = self:get_next_char(line)
-- Add image only if it is visible (at least partly)
if x + self.widths[codepoint] >= 0 and x <= texturew then
texture = texture..
string.format(":%d,%d=font_%s_%04x.png",
x, y, self.name, codepoint)
end
x = x + self.widths[codepoint]
end
return texture
end
--- Builds texture for a multiline colored text
-- @param text Text to be rendered
-- @param texturew Width of the texture (extra text will be truncated)
-- @param textureh Height of the texture
-- @param maxlines Maximum number of lines
-- @param halign Horizontal text align ("left"/"center"/"right") (optional)
-- @param valign Vertical text align ("top"/"center"/"bottom") (optional)
-- @param color Color of the text (optional)
-- @return Texture string
--- Legacy make_text_texture method (replaced by "render" - Dec 2018)
function Font:make_text_texture(text, texturew, textureh, maxlines,
halign, valign, color)
local texture = ""
local lines = {}
local textheight = 0
local y
halign, valign, color)
return self:render(text, texturew, textureh, {
lines = maxlines,
valign = valign,
halign = halign,
color = color
})
end
-- Split text into lines (limited to maxlines fist lines)
for num, line in pairs(split_lines(text, maxlines)) do
lines[num] = { text = line, width = self:get_width(line) }
--- Render text with the font in a view
-- @param text Text to be rendered
-- @param texturew Width (in pixels) of the texture (extra text will be truncated)
-- @param textureh Height (in pixels) of the texture (extra text will be truncated)
-- @param style Style of the rendering:
-- - lines: maximum number of text lines (if text is limited)
-- - halign: horizontal align ("left"/"center"/"right")
-- - valign: vertical align ("top"/"center"/"bottom")
-- - color: color of the text ("#rrggbb")
-- @return Texture string
function Font:render(text, texturew, textureh, style)
local style = style or {}
-- Split text into lines (and limit to style.lines # of lines)
local lines = {}
local pos = 1
local found, line
repeat
found = string.find(text, "\n", pos) or (#text + 1)
line = string.sub(text, pos, found - 1)
lines[#lines + 1] = { text = line, width = self:get_width(line) }
pos = found + 1
until (style.lines and (#lines >= style.lines)) or (pos > (#text + 1))
if not #lines then
return ""
end
textheight = self:get_height(#lines)
local x, y, codepoint
local texture = ""
local textheight = self:get_height(#lines)
if #lines then
if valign == "top" then
y = 0
elseif valign == "bottom" then
y = textureh - textheight
else
y = (textureh - textheight) / 2
end
if style.valign == "top" then
y = 0
elseif style.valign == "bottom" then
y = textureh - textheight
else
y = (textureh - textheight) / 2
end
y = y + (self.margintop or 0)
for _, line in pairs(lines) do
if halign == "left" then
texture = texture..
self:make_line_texture(line.text, texturew,
0, y)
elseif halign == "right" then
texture = texture..
self:make_line_texture(line.text, texturew,
texturew - line.width, y)
if style.halign == "left" then
x = 0
elseif style.halign == "right" then
x = texturew - line.width
else
texture = texture..
self:make_line_texture(line.text, texturew,
(texturew - line.width) / 2, y)
x = (texturew - line.width) / 2
end
while line.text ~= '' do
codepoint, line.text = self:get_next_char(line.text)
if codepoint == nil then return '' end -- UTF Error
-- Add image only if it is visible (at least partly)
if x + self.widths[codepoint] >= 0 and x <= texturew then
texture = texture..
string.format(":%d,%d=font_%s_%04x.png", x, y, self.name, codepoint)
end
x = x + self.widths[codepoint]
end
y = y + self:get_height() + (self.linespacing or 0)
end
texture = string.format("[combine:%dx%d", texturew, textureh)..texture
if color then texture = texture.."^[colorize:"..color end
if style.color then
texture = texture.."^[colorize:"..style.color
end
return texture
end

View File

@ -1,20 +1,19 @@
--[[
font_api mod for Minetest - Library to add font display capability
to display_api mod.
(c) Pierre-Yves Rollo
font_api mod for Minetest - Library creating textures with fonts and text
(c) Pierre-Yves Rollo
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
--]]
local modname = minetest.get_current_modname()
@ -101,16 +100,18 @@ local function show_font_formspec(playername)
end
table.sort(fonts)
local fs = 'size[4,'..(#fonts + 0.8)..']'
..default.gui_bg..default.gui_bg_img..default.gui_slots
..'button_exit[0,'..(#fonts)..';4,1;cancel;Cancel]'
local fs = string.format(
"size[4,%s]%s%s%sbutton_exit[0,%s;4,1;cancel;Cancel]",
#fonts + 0.8, default.gui_bg, default.gui_bg_img, default.gui_slots,
#fonts)
for line = 1, #fonts do
local font = font_api.get_font(fonts[line])
fs = fs..'image[0.1,'..(line-0.9)..';4.5,0.8;'
..font:make_text_texture(font.name, font:get_height()*5,
local texture = font:make_text_texture(font.name, font:get_height()*5,
font:get_height()*1.2, 1, "center", "top", "#fff")
..']button_exit[0,'..(line-1)..';4,1;font_'..font.name..';]'
fs = string.format(
"%simage[0.1,%s;4.5,0.8;%s]button_exit[0,%s;4,1;font_%s;]",
fs, line-0.9, texture, line-1, font.name)
end
minetest.show_formspec(context.playername, modname..':font_list', fs)
end
@ -127,7 +128,8 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
local playername = player:get_player_name()
local context = get_context(playername)
if minetest.is_protected(context.pos, playername) then
if not context.pos
or minetest.is_protected(context.pos, playername) then
return true
end
@ -139,16 +141,26 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
display_api.update_entities(context.pos)
end
end
-- Using after to avoid the "double close" bug
minetest.after(0, show_node_formspec, playername, context.pos)
if context.callback and type(context.callback) == "function" then
-- Using after to avoid the "double close" bug
minetest.after(0, context.callback, playername, context.pos)
else
-- Using after to avoid the "double close" bug
minetest.after(0, show_node_formspec, playername, context.pos)
end
end
return true
end)
function font_api.show_font_list_from_pos(player, pos)
-- @param player Player viewing the form
-- @param pos Node pos
-- @param callback function(playername, pos) to be called on form close
function font_api.show_font_list(player, pos, callback)
if minetest.is_player(player) then
local context = get_context(player:get_player_name())
context.pos = pos
context.callback = callback
show_font_formspec(player:get_player_name())
end
end

View File

@ -1,20 +1,19 @@
--[[
font_api mod for Minetest - Library to add font display capability
to display_api mod.
(c) Pierre-Yves Rollo
font_api mod for Minetest - Library creating textures with fonts and text
(c) Pierre-Yves Rollo
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
--]]
-- Global variables
@ -30,36 +29,7 @@ font_api.path = minetest.get_modpath(font_api.name)
dofile(font_api.path.."/font.lua")
dofile(font_api.path.."/registry.lua")
dofile(font_api.path.."/fontform.lua")
--- Standard on_display_update entity callback.
-- Node should have a corresponding display_entity with size, resolution and
-- maxlines fields and optionally halign, valign and color fields
-- @param pos Node position
-- @param objref Object reference of entity
function font_api.on_display_update(pos, objref)
local meta = minetest.get_meta(pos)
local text = meta:get_string("display_text")
local ndef = minetest.registered_nodes[minetest.get_node(pos).name]
local entity = objref:get_luaentity()
if entity and ndef.display_entities[entity.name] then
local def = ndef.display_entities[entity.name]
local font = font_api.get_font(meta:get_string("font") ~= ""
and meta:get_string("font") or def.font_name)
local maxlines = def.maxlines or 1 -- TODO:How to do w/o maxlines ?
objref:set_properties({
textures={font:make_text_texture(text,
font:get_height(maxlines) * def.size.x / def.size.y
/ (def.aspect_ratio or 1),
font:get_height(maxlines),
def.maxlines, def.halign, def.valign, def.color)},
visual_size = def.size
})
end
if minetest.get_modpath("display_api") then
dofile(font_api.path.."/display_api.lua")
end
-- Compatibility
font_lib = font_api
dofile(font_api.path.."/deprecation.lua")

3
font_api/mod.conf Normal file
View File

@ -0,0 +1,3 @@
name=font_api
description=A library for rendernig text on textures
optional_depends=display_api

View File

@ -1,20 +1,19 @@
--[[
font_api mod for Minetest - Library to add font display capability
to display_api mod.
(c) Pierre-Yves Rollo
font_api mod for Minetest - Library creating textures with fonts and text
(c) Pierre-Yves Rollo
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
--]]
-- Global variables
@ -124,9 +123,9 @@ end
-- @param def font definition. A associative array with following keys :
-- @key default True (by default) if this font may be used as default font
-- @key height (mandatory) Height in pixels of all font textures
-- @key widths (mandatory) Array of character widths in pixels, indexed by
-- @key widths (mandatory) Array of character widths in pixels, indexed by
-- UTF codepoints
-- @key margintop (optional) Margin (in texture pixels) added on top of each
-- @key margintop (optional) Margin (in texture pixels) added on top of each
-- char texture.
-- @key marginbottom (optional) dded at bottom of each char texture.
-- @key linespacing (optional) Spacing (in texture pixels) between each lines.
@ -144,19 +143,18 @@ function font_api.register_font(font_name, font_def)
local font = font_api.Font:new(font_def)
if font == nil then
if font == nil then
minetest.log("error", "Unable to register font \""..font_name.."\".")
return
end
font.name = font_name
font_api.registered_fonts[font_name] = font
font_api.registered_fonts_number = font_api.registered_fonts_number + 1
-- Force to choose again default font
-- (allows use of fonts registered after start)
default_font = false
minetest.log("action", "New font registered in font_api: "..font_name..".")
end

60
font_metro/CC-BY-SA.txt Normal file
View File

@ -0,0 +1,60 @@
THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
1. Definitions
"Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License.
"Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(f) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined below) for the purposes of this License.
"Creative Commons Compatible License" means a license that is listed at https://creativecommons.org/compatiblelicenses that has been approved by Creative Commons as being essentially equivalent to this License, including, at a minimum, because that license: (i) contains terms that have the same purpose, meaning and effect as the License Elements of this License; and, (ii) explicitly permits the relicensing of adaptations of works made available under that license under this License or a Creative Commons jurisdiction license with the same License Elements as this License.
"Distribute" means to make available to the public the original and copies of the Work or Adaptation, as appropriate, through sale or other transfer of ownership.
"License Elements" means the following high-level license attributes as selected by Licensor and indicated in the title of this License: Attribution, ShareAlike.
"Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License.
"Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast.
"Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work.
"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
"Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images.
"Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium.
2. Fair Dealing Rights. Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws.
3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections;
to create and Reproduce Adaptations provided that any such Adaptation, including any translation in any medium, takes reasonable steps to clearly label, demarcate or otherwise identify that changes were made to the original Work. For example, a translation could be marked "The original work was translated from English to Spanish," or a modification could indicate "The original work has been modified.";
to Distribute and Publicly Perform the Work including as incorporated in Collections; and,
to Distribute and Publicly Perform Adaptations.
For the avoidance of doubt:
Non-waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License;
Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor waives the exclusive right to collect such royalties for any exercise by You of the rights granted under this License; and,
Voluntary License Schemes. The Licensor waives the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License.
The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. Subject to Section 8(f), all rights not expressly granted by Licensor are hereby reserved.
4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(c), as requested. If You create an Adaptation, upon notice from any Licensor You must, to the extent practicable, remove from the Adaptation any credit as required by Section 4(c), as requested.
You may Distribute or Publicly Perform an Adaptation only under the terms of: (i) this License; (ii) a later version of this License with the same License Elements as this License; (iii) a Creative Commons jurisdiction license (either this or a later license version) that contains the same License Elements as this License (e.g., Attribution-ShareAlike 3.0 US)); (iv) a Creative Commons Compatible License. If you license the Adaptation under one of the licenses mentioned in (iv), you must comply with the terms of that license. If you license the Adaptation under the terms of any of the licenses mentioned in (i), (ii) or (iii) (the "Applicable License"), you must comply with the terms of the Applicable License generally and the following provisions: (I) You must include a copy of, or the URI for, the Applicable License with every copy of each Adaptation You Distribute or Publicly Perform; (II) You may not offer or impose any terms on the Adaptation that restrict the terms of the Applicable License or the ability of the recipient of the Adaptation to exercise the rights granted to that recipient under the terms of the Applicable License; (III) You must keep intact all notices that refer to the Applicable License and to the disclaimer of warranties with every copy of the Work as included in the Adaptation You Distribute or Publicly Perform; (IV) when You Distribute or Publicly Perform the Adaptation, You may not impose any effective technological measures on the Adaptation that restrict the ability of a recipient of the Adaptation from You to exercise the rights granted to that recipient under the terms of the Applicable License. This Section 4(b) applies to the Adaptation as incorporated in a Collection, but this does not require the Collection apart from the Adaptation itself to be made subject to the terms of the Applicable License.
If You Distribute, or Publicly Perform the Work or any Adaptations or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and (iv) , consistent with Ssection 3(b), in the case of an Adaptation, a credit identifying the use of the Work in the Adaptation (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). The credit required by this Section 4(c) may be implemented in any reasonable manner; provided, however, that in the case of a Adaptation or Collection, at a minimum such credit will appear, if a credit for all contributing authors of the Adaptation or Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties.
Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Adaptations or Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author's honor or reputation. Licensor agrees that in those jurisdictions (e.g. Japan), in which any exercise of the right granted in Section 3(b) of this License (the right to make Adaptations) would be deemed to be a distortion, mutilation, modification or other derogatory action prejudicial to the Original Author's honor and reputation, the Licensor will waive or not assert, as appropriate, this Section, to the fullest extent permitted by the applicable national law, to enable You to reasonably exercise Your right under Section 3(b) of this License (right to make Adaptations) but not otherwise.
5. Representations, Warranties and Disclaimer
UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
7. Termination
This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Adaptations or Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
8. Miscellaneous
Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
Each time You Distribute or Publicly Perform an Adaptation, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law.

458
font_metro/LGPL.txt Normal file
View File

@ -0,0 +1,458 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS

View File

@ -1,3 +0,0 @@
This work is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.

19
font_metro/README.md Normal file
View File

@ -0,0 +1,19 @@
# Metro font minetest mod for font API
This mod adds Metro font to Font API mod (from [display_modpack](https://github.com/pyrollo/display_modpack)).
For more information, see the [forum topic](https://forum.minetest.net/viewtopic.php?t=13563) at the Minetest forums.
This font includes uppercase, lowercase and many accentuated latin letters, greek and cyrillic letters.
![Font Botic Preview](screenshot.png)
**Dependancies**: font_api
**License**: code under LGPL v2.1, font under CC-BY-SA 3.0
## Original Font
**Original font**: [Metro by Christian Munk](https://fontstruct.com/fontstructions/show/723864/metro_sans)
**License**: CC-BY-SA

3
font_metro/mod.conf Normal file
View File

@ -0,0 +1,3 @@
name=font_metro
description=Metro font (latin, accents, cyrillic, greek) for font_api
depends=font_api

BIN
font_metro/screenshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

4
ontime_clocks/mod.conf Normal file
View File

@ -0,0 +1,4 @@
name=ontime_clocks
description=Clocks displaing real ingame time
depends=default,dye,display_api
optional_depends=intllib

View File

@ -1,5 +1,5 @@
--[[
ontime_clocks mod for Minetest - Clock nodes displaying ingame time
ontime_clocks mod for Minetest - Clock nodes displaying ingame time
(c) Pierre-Yves Rollo
This file is part of ontime_clocks.
@ -31,11 +31,11 @@ minetest.register_node("ontime_clocks:green_digital", {
node_box = {
type = "wallmounted",
wall_side = { -0.5, -3/16, -7/16, -13/32, 7/32, 7/16 },
wall_bottom = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 },
wall_top = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 }
wall_top = { -7/16, 0.5, -7/32, 7/16, 13/32, 3/16 },
wall_bottom = { -7/16, -0.5, -3/16, 7/16, -13/32, 7/32 },
},
tiles = {"ontime_clocks_digital.png"},
groups = {oddly_breakable_by_hand = 1, not_blocking_trains = 1, display_modpack_node = 1},
groups = {oddly_breakable_by_hand=1, not_blocking_trains=1, display_api=1},
display_entities = {
["ontime_clocks:display"] = {
depth = 13/32 - 0.01,
@ -69,11 +69,11 @@ minetest.register_node("ontime_clocks:red_digital", {
node_box = {
type = "wallmounted",
wall_side = { -0.5, -3/16, -7/16, -13/32, 7/32, 7/16 },
wall_bottom = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 },
wall_top = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 }
wall_bottom = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 },
wall_top = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 }
},
tiles = {"ontime_clocks_digital.png"},
groups = {oddly_breakable_by_hand = 1, not_blocking_trains = 1, display_modpack_node = 1},
groups = {oddly_breakable_by_hand=1, not_blocking_trains=1, display_api=1},
display_entities = {
["ontime_clocks:display"] = {
depth = 13/32 - 0.01,
@ -107,12 +107,12 @@ minetest.register_node("ontime_clocks:white", {
node_box = {
type = "wallmounted",
wall_side = { -0.5, -7/16, -7/16, -6/16, 7/16, 7/16},
wall_bottom = { -7/16, -0.5, -7/16, 7/16, -7/16, 7/16},
wall_top = { -7/16, 0.5, -7/16, 7/16, 7/16, 7/16},
wall_bottom = { -7/16, -0.5, -7/16, 7/16, -7/16, 7/16},
wall_top = { -7/16, 0.5, -7/16, 7/16, 7/16, 7/16},
},
tiles = {"ontime_clocks_white.png"},
groups = {choppy = 1, oddly_breakable_by_hand = 1, not_blocking_trains = 1, display_modpack_node = 1},
display_entities = {
groups = {oddly_breakable_by_hand=1, not_blocking_trains=1, display_api=1},
display_entities = {
["ontime_clocks:display"] = {
depth = 6/16 - 0.01,
on_display_update = function(pos, objref)
@ -144,12 +144,12 @@ minetest.register_node("ontime_clocks:frameless_black", {
node_box = {
type = "wallmounted",
wall_side = { -0.5, -7/16, -7/16, -0.45, 7/16, 7/16 },
wall_bottom = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 },
wall_top = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 }
wall_bottom = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 },
wall_top = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 }
},
tiles = {"ontime_clocks_frameless.png"},
groups = {choppy = 1, oddly_breakable_by_hand = 1, not_blocking_trains = 1, display_modpack_node = 1},
display_entities = {
groups = {oddly_breakable_by_hand=1, not_blocking_trains=1, display_api=1},
display_entities = {
["ontime_clocks:display"] = {
depth = 7/16,
on_display_update = function(pos, objref)
@ -181,12 +181,12 @@ minetest.register_node("ontime_clocks:frameless_gold", {
node_box = {
type = "wallmounted",
wall_side = { -0.5, -7/16, -7/16, -0.45, 7/16, 7/16 },
wall_bottom = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 },
wall_top = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 }
wall_bottom = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 },
wall_top = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 }
},
tiles = {"ontime_clocks_frameless.png^[colorize:#FF0"},
groups = {choppy = 1, oddly_breakable_by_hand = 1, not_blocking_trains = 1, display_modpack_node = 1},
display_entities = {
groups = {oddly_breakable_by_hand=1, not_blocking_trains=1, display_api=1},
display_entities = {
["ontime_clocks:display"] = {
depth = 7/16,
on_display_update = function(pos, objref)
@ -218,12 +218,12 @@ minetest.register_node("ontime_clocks:frameless_white", {
node_box = {
type = "wallmounted",
wall_side = { -0.5, -7/16, -7/16, -0.45, 7/16, 7/16 },
wall_bottom = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 },
wall_top = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 }
wall_bottom = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 },
wall_top = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 }
},
tiles = {"ontime_clocks_frameless.png^[colorize:#FFF"},
groups = {choppy = 1, oddly_breakable_by_hand = 1, not_blocking_trains = 1, display_modpack_node = 1},
display_entities = {
groups = {oddly_breakable_by_hand=1, not_blocking_trains=1, display_api=1},
display_entities = {
["ontime_clocks:display"] = {
depth = 7/16,
on_display_update = function(pos, objref)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 434 KiB

After

Width:  |  Height:  |  Size: 348 KiB

View File

@ -21,40 +21,6 @@
local S = signs.intllib
local F = function(...) return minetest.formspec_escape(S(...)) end
--Backwards compatibility functions
signs.set_display_text = function(...)
minetest.log("warning", "signs.set_display_text() is deprecated, please use signs_api.set_display_text() instead.")
return signs_api.set_display_text(...)
end
signs.set_formspec = function(...)
minetest.log("warning", "signs.set_formspec() is deprecated, please use signs_api.set_formspec() instead.")
return signs_api.set_formspec(...)
end
signs.on_receive_fields = function(...)
minetest.log("warning", "signs.on_receive_fields() is deprecated, please use signs_api.on_receive_fields() instead.")
return signs_api.on_receive_fields(...)
end
signs.on_place_direction = function(...)
minetest.log("warning", "signs.on_place_direction() is deprecated, please use signs_api.on_place_direction() instead.")
return signs_api.on_place_direction(...)
end
signs.on_rotate = function(...)
minetest.log("warning", "signs.on_rotate() is deprecated, please use signs_api.on_rotate() instead.")
return signs_api.on_rotate(...)
end
signs.register_sign = function(...)
minetest.log("warning", "signs.register_sign() is deprecated, please use signs_api.register_sign() instead.")
return signs_api.register_sign(...)
end
-- Generic callback for show_formspec displayed formspecs of "sign" mod
minetest.register_on_player_receive_fields(function(player, formname, fields)

View File

@ -23,7 +23,7 @@
------------------------------------
local wallmounted_to_facedir = {
[0]=1, -- Should not happend with signs
[0]=1, -- Should not happend with signs
[1]=1, -- Should not happend with signs
[2]=1,
[3]=3,
@ -84,7 +84,34 @@ minetest.register_lbm({ name = "signs:conpatibility_2",
action = compatibility_check_2,
})
--Backwards compatibility API functions
signs.set_display_text = function(...)
minetest.log("warning", "signs.set_display_text() is deprecated, please use signs_api.set_display_text() instead.")
return signs_api.set_display_text(...)
end
signs.set_formspec = function(...)
minetest.log("warning", "signs.set_formspec() is deprecated, please use signs_api.set_formspec() instead.")
return signs_api.set_formspec(...)
end
signs.on_receive_fields = function(...)
minetest.log("warning", "signs.on_receive_fields() is deprecated, please use signs_api.on_receive_fields() instead.")
return signs_api.on_receive_fields(...)
end
signs.on_place_direction = function(...)
minetest.log("warning", "signs.on_place_direction() is deprecated, please use signs_api.on_place_direction() instead.")
return signs_api.on_place_direction(...)
end
signs.on_rotate = function(...)
minetest.log("warning", "signs.on_rotate() is deprecated, please use signs_api.on_rotate() instead.")
return signs_api.on_rotate(...)
end
signs.register_sign = function(...)
minetest.log("warning", "signs.register_sign() is deprecated, please use signs_api.register_sign() instead.")
return signs_api.register_sign(...)
end

View File

@ -54,7 +54,7 @@ minetest.register_craft({
})
minetest.register_craft({
output = 'signs:label_small',
output = 'signs:label_medium',
recipe = {
{'default:paper', 'default:paper', 'dye:black'},
}

View File

@ -1,5 +1,4 @@
default
intllib?
display_api
font_api
dye
signs_api
intllib?

4
signs/mod.conf Normal file
View File

@ -0,0 +1,4 @@
name=signs
description=Basic signs and posters with text display using signs_api
depends=default,dye,signs_api
optional_depends=intllib

View File

@ -23,51 +23,57 @@ local F = function(...) return minetest.formspec_escape(S(...)) end
-- Poster specific formspec
local function display_poster(pos, node, player)
local formspec
local meta = minetest.get_meta(pos)
local def = minetest.registered_nodes[node.name].display_entities["signs:display_text"]
local font = font_api.get_font(meta:get_string("font") or def.font_name)
-- Title texture
local titletexture = font:make_text_texture(
meta:get_string("display_text"), font:get_height()*8.4, font:get_height(), 1, "center")
local fs
local fname = string.format("%s@%s:display",
node.name, minetest.pos_to_string(pos))
formspec =
"size[7,9]"..
"background[0,0;7,9;signs_poster_formspec.png]"..
"image[0,-0.2;8.4,2;"..titletexture.."]"..
"textarea[0.3,1.5;7,8;;"..minetest.colorize("#111", minetest.formspec_escape(meta:get_string("text")))..";]"..
"bgcolor[#0000]"
-- Title texture
local titletexture = font:render(meta:get_string("display_text"),
font:get_height()*8.4, font:get_height(), { lines = 1 })
fs = string.format([=[
size[7,9]bgcolor[#0000]
background[0,0;7,9;signs_poster_formspec.png]
image[0,-0.2;8.4,2;%s]
textarea[0.3,1.5;7,8;;%s;]]=],
titletexture,
minetest.colorize("#111",
minetest.formspec_escape(meta:get_string("text"))))
if minetest.is_protected(pos, player:get_player_name()) then
formspec = formspec..
"button_exit[2.5,8;2,1;ok;"..F("Close").."]"
fs = string.format("%sbutton_exit[2.5,8;2,1;ok;%s]", fs, F("Close"))
else
formspec = formspec..
"button[1,8;2,1;edit;"..F("Edit").."]"..
"button_exit[4,8;2,1;ok;"..F("Close").."]"
fs = string.format(
"%sbutton[1,8;2,1;edit;%s]button_exit[4,8;2,1;ok;%s]",
fs, F("Edit"), F("Close"))
end
minetest.show_formspec(player:get_player_name(),
node.name.."@"..minetest.pos_to_string(pos)..":display",
formspec)
minetest.show_formspec(player:get_player_name(), fname, fs)
end
local function edit_poster(pos, node, player)
local formspec
local meta = minetest.get_meta(pos)
local fs
local fname = string.format("%s@%s:edit",
node.name, minetest.pos_to_string(pos))
if not minetest.is_protected(pos, player:get_player_name()) then
formspec =
"size[6.5,7.5]"..
default.gui_bg .. default.gui_bg_img .. default.gui_slots ..
"field[0.5,0.7;6,1;display_text;"..F("Title")..";"..
minetest.formspec_escape(meta:get_string("display_text")).."]"..
"textarea[0.5,1.7;6,6;text;"..F("Text")..";"..
minetest.formspec_escape(meta:get_string("text")).."]"..
"button_exit[2.25,7;2,1;write;"..F("Write").."]"
minetest.show_formspec(player:get_player_name(),
node.name.."@"..minetest.pos_to_string(pos)..":edit",
formspec)
fs = string.format([=[
size[6.5,7.5]%s%s%s
field[0.5,0.7;6,1;display_text;%s;%s]
textarea[0.5,1.7;6,6;text;%s;%s]
button[1.25,7;2,1;font;%s]
button_exit[3.25,7;2,1;write;%s]]=],
default.gui_bg, default.gui_bg_img, default.gui_slots, F("Title"),
minetest.formspec_escape(meta:get_string("display_text")),
F("Text"), minetest.formspec_escape(meta:get_string("text")),
F("Title font"), F("Write"))
minetest.show_formspec(player:get_player_name(), fname, fs)
end
end
@ -80,15 +86,29 @@ local function on_receive_fields_poster(pos, formname, fields, player)
if formname == node.name.."@"..minetest.pos_to_string(pos)..":display"
and fields.edit then
edit_poster(pos, node, player)
return true
end
if formname == node.name.."@"..minetest.pos_to_string(pos)..":edit"
and (fields.write or fields.key_enter) then
meta:set_string("display_text", fields.display_text)
meta:set_string("text", fields.text)
meta:set_string("infotext", "\""..fields.display_text
.."\"\n"..S("(right-click to read more text)"))
display_api.update_entities(pos)
display_poster(pos, node, player)
then
if (fields.write or fields.font or fields.key_enter) then
meta:set_string("display_text", fields.display_text)
meta:set_string("text", fields.text)
meta:set_string("infotext", "\""..fields.display_text
.."\"\n"..S("(right-click to read more text)"))
display_api.update_entities(pos)
end
if (fields.write or fields.key_enter) then
display_poster(pos, node, player)
elseif (fields.font) then
font_api.show_font_list(player, pos, function (playername, pos)
local player = minetest.get_player_by_name(playername)
local node = minetest.get_node(pos)
if player and node then
edit_poster(pos, node, player)
end
end)
end
return true
end
end
end

View File

@ -75,15 +75,15 @@
inkscape:pageshadow="2"
inkscape:zoom="22.395604"
inkscape:cx="15.573035"
inkscape:cy="16.977299"
inkscape:cy="16.910322"
inkscape:current-layer="layer2"
showgrid="true"
inkscape:grid-bbox="true"
inkscape:document-units="px"
inkscape:window-width="785"
inkscape:window-height="447"
inkscape:window-x="2459"
inkscape:window-y="340"
inkscape:window-width="1441"
inkscape:window-height="1038"
inkscape:window-x="2012"
inkscape:window-y="467"
inkscape:window-maximized="0"
showguides="true"
inkscape:guide-bbox="true"
@ -197,7 +197,7 @@
inkscape:groupmode="layer"
id="layer2"
inkscape:label="Label frame"
style="display:inline">
style="display:none">
<rect
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#ff41c1;fill-opacity:0.41711228;fill-rule:nonzero;stroke:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
id="rect4585"
@ -205,7 +205,10 @@
height="16"
x="8"
y="8"
ry="0" />
ry="0"
inkscape:export-filename="/home/pyrollo/dev/minetest-mods/display_modpack/signs/textures/signs_label.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90" />
<rect
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#ff41c1;fill-opacity:0.41711228;fill-rule:nonzero;stroke:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
id="rect4585-3"

Before

Width:  |  Height:  |  Size: 1.7 MiB

After

Width:  |  Height:  |  Size: 1.7 MiB

View File

@ -27,3 +27,7 @@ Handles screwdriver rotation. Direction is affected for direction signs.
### `signs_api.register_sign(mod, name, model)`
A method to quickly register signs.
## Changelog
### 2019-03-14
- __sign_api__: Screwdriver behavior changed. Now, left click rotates and changes direction.

View File

@ -47,7 +47,7 @@ function signs_api.set_formspec(pos)
if ndef and ndef.display_entities
and ndef.display_entities["signs:display_text"] then
local maxlines = ndef.display_entities["signs:display_text"].maxlines
local fs, x, y
local fs, y
if maxlines == 1 then
fs = "field[0.5,0.7;5.5,1;display_text;"..F("Text")..
@ -64,17 +64,8 @@ function signs_api.set_formspec(pos)
y = 2.4
end
x = 0.2
fs = fs.."image_button["..x..","..y..";0.5,0.5;font_api_font.png;font;]"
x = x + 0.4
fs = fs.."image_button["..x..","..y..";0.5,0.5;font_api_left.png;left;]"
x = x + 0.4
fs = fs.."image_button["..x..","..y..";0.5,0.5;font_api_center.png;center;]"
x = x + 0.4
fs = fs.."image_button["..x..","..y..";0.5,0.5;font_api_right.png;right;]"
y = y + 0.7
fs = fs.."button_exit[2,"..y..";2,1;ok;"..
F("Write").."]"
fs = fs.."button[1,"..y..";2,1;font;"..F("Font").."]"
fs = fs.."button_exit[3,"..y..";2,1;ok;"..F("Write").."]"
y = y + 0.8
fs = "size[6,"..y.."]"..default.gui_bg..
default.gui_bg_img..default.gui_slots..fs
@ -90,7 +81,7 @@ function signs_api.on_receive_fields(pos, formname, fields, player)
end
if fields and (fields.font) then
signs_api.set_display_text(pos, fields.display_text)
font_api.show_font_list_from_pos(player, pos)
font_api.show_font_list(player, pos)
end
end
end
@ -100,37 +91,42 @@ end
function signs_api.on_place_direction(itemstack, placer, pointed_thing)
local name = itemstack:get_name()
local ndef = minetest.registered_nodes[name]
local restriction = display_api.is_rotation_restricted()
local bdir = {
x = pointed_thing.under.x - pointed_thing.above.x,
y = pointed_thing.under.y - pointed_thing.above.y,
z = pointed_thing.under.z - pointed_thing.above.z}
local bdir = {x = pointed_thing.under.x - pointed_thing.above.x,
y = pointed_thing.under.y - pointed_thing.above.y,
z = pointed_thing.under.z - pointed_thing.above.z}
local pdir = placer:get_look_dir()
local ndir, test
if ndef.paramtype2 == "facedir" then
if bdir.x == 0 and bdir.z == 0 then
-- If legacy mode, only accept upright nodes
if restriction and bdir.x == 0 and bdir.z == 0 then
-- Ceiling or floor pointed (facedir chosen from player dir)
ndir = minetest.dir_to_facedir({x=pdir.x, y=0, z=pdir.z})
else
-- Wall pointed
ndir = minetest.dir_to_facedir(bdir)
-- Wall pointed or no rotation restriction
ndir = minetest.dir_to_facedir(bdir, not restriction)
end
test = {[0]=-pdir.x, pdir.z, pdir.x, -pdir.z}
end
test = { [0]=-pdir.x, pdir.z, pdir.x, -pdir.z, -pdir.x, [8]=pdir.x }
end
if ndef.paramtype2 == "wallmounted" then
ndir = minetest.dir_to_wallmounted(bdir)
if ndir == 0 or ndir == 1 then
-- Ceiling or floor
-- If legacy mode, only accept upright nodes
if restriction and (ndir == 0 or ndir == 1) then
ndir = minetest.dir_to_wallmounted({x=pdir.x, y=0, z=pdir.z})
end
test = {0, pdir.z, -pdir.z, -pdir.x, pdir.x}
test = { [0]=-pdir.x, -pdir.x, pdir.z, -pdir.z, -pdir.x, pdir.x}
end
-- Only for direction signs
-- TODO:Maybe improve ground and ceiling placement in every directions
if ndef.signs_other_dir then
if test[ndir] > 0 then
itemstack:set_name(ndef.signs_other_dir)
@ -144,20 +140,48 @@ function signs_api.on_place_direction(itemstack, placer, pointed_thing)
end
end
-- Handles screwdriver rotation. Direction is affected for direction signs
-- If rotation mode is 2 and sign is directional, swap direction.
-- Otherwise use display_api's on_rotate function.
function signs_api.on_rotate(pos, node, player, mode, new_param2)
if mode == 2 then
-- Handles screwdriver rotation
-- (see "if" block below for rotation restriction mode).
signs_api.on_rotate = function(pos, node, player, mode, new_param2)
-- If rotation mode is 1 and sign is directional, swap direction between
-- each rotation.
if mode == 1 then
local ndef = minetest.registered_nodes[node.name]
if ndef.signs_other_dir then
minetest.swap_node(pos, {name = ndef.signs_other_dir,
param1 = node.param1, param2 = node.param2})
-- Switch direction
node = {name = ndef.signs_other_dir,
param1 = node.param1, param2 = node.param2}
minetest.swap_node(pos, node)
display_api.update_entities(pos)
return true
-- Rotate only if not "main" sign
-- TODO:Improve detection of "main" direction sign
if ndef.groups and ndef.groups.not_in_creative_inventory then
return display_api.on_rotate(pos, node, player, mode, new_param2)
else
return true
end
end
end
return display_api.on_rotate(pos, node, user, mode, new_param2)
return display_api.on_rotate(pos, node, player, mode, new_param2)
end
-- Legacy mode with rotation restriction
-- TODO:When MT < 5.0 no more in use, to be removed
if display_api.is_rotation_restricted() then
signs_api.on_rotate = function(pos, node, player, mode, new_param2)
-- If rotation mode is 2 and sign is directional, swap direction.
-- Otherwise use display_api's on_rotate function.
if mode == 2 then
local ndef = minetest.registered_nodes[node.name]
if ndef.signs_other_dir then
minetest.swap_node(pos, {name = ndef.signs_other_dir,
param1 = node.param1, param2 = node.param2})
display_api.update_entities(pos)
return true
end
end
return display_api.on_rotate(pos, node, player, mode, new_param2)
end
end
function signs_api.register_sign(mod, name, model)
@ -172,7 +196,7 @@ function signs_api.register_sign(mod, name, model)
fixed = {-model.width/2, -model.height/2, 0.5,
model.width/2, model.height/2, 0.5 - model.depth},
},
groups = {choppy=2, dig_immediate=2, not_blocking_trains = 1, display_modpack_node = 1},
groups = {choppy=2, dig_immediate=2, not_blocking_trains=1, display_api=1},
sounds = default.node_sound_defaults(),
display_entities = {
["signs:display_text"] = {

4
signs_api/mod.conf Normal file
View File

@ -0,0 +1,4 @@
name=signs_api
description=A library providing various helper functions for registereing signs with text display
depends=default,display_api,font_api
optional_depends=intllib

View File

@ -22,7 +22,7 @@
------------------------------------
local wallmounted_to_facedir = {
[0]=1, -- Should not happend with signs
[0]=1, -- Should not happend with signs
[1]=1, -- Should not happend with signs
[2]=1,
[3]=3,
@ -82,4 +82,9 @@ minetest.register_lbm({ name = "signs_road:conpatibility_2",
action = compatibility_check_2,
})
-- Node name tidy up
--------------------
minetest.register_alias("signs_road:green_street_sign", "signs_road:green_sign")
minetest.register_alias("signs_road:yellow_street_sign", "signs_road:yellow_sign")
minetest.register_alias("signs_road:white_street_sign", "signs_road:white_sign")

View File

@ -19,26 +19,10 @@
along with signs_road. If not, see <http://www.gnu.org/licenses/>.
--]]
minetest.register_craft({
output = 'signs_road:blue_street_sign 2',
recipe = {
{'dye:blue', 'dye:white', ''},
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
{'', '', ''},
}
})
-- Standard rectangle signs
minetest.register_craft({
output = 'signs_road:red_street_sign 2',
recipe = {
{'dye:white', 'dye:red', ''},
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
{'', '', ''},
}
})
minetest.register_craft({
output = 'signs_road:white_street_sign 2',
output = 'signs_road:white_sign 2',
recipe = {
{'dye:white', 'dye:black', ''},
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
@ -47,13 +31,16 @@ minetest.register_craft({
})
minetest.register_craft({
type = "shapeless",
output = 'signs_road:large_street_sign',
recipe = {'signs_road:white_street_sign', 'signs_road:white_street_sign', 'signs_road:white_street_sign', 'signs_road:white_street_sign'},
output = 'signs_road:blue_sign 2',
recipe = {
{'dye:blue', 'dye:white', ''},
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
{'', '', ''},
}
})
minetest.register_craft({
output = 'signs_road:green_street_sign 2',
output = 'signs_road:green_sign 2',
recipe = {
{'dye:green', 'dye:white', ''},
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
@ -62,7 +49,7 @@ minetest.register_craft({
})
minetest.register_craft({
output = 'signs_road:yellow_street_sign 2',
output = 'signs_road:yellow_sign 2',
recipe = {
{'dye:yellow', 'dye:black', ''},
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
@ -70,6 +57,16 @@ minetest.register_craft({
}
})
minetest.register_craft({
output = 'signs_road:red_sign 2',
recipe = {
{'dye:red', 'dye:white', ''},
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
{'', '', ''},
}
})
-- Standard direction signs
minetest.register_craft({
output = 'signs_road:black_right_sign 2',
@ -80,6 +77,24 @@ minetest.register_craft({
}
})
minetest.register_craft({
output = 'signs_road:white_right_sign 2',
recipe = {
{'dye:white', 'dye:black', 'default:steel_ingot'},
{'default:steel_ingot', 'default:steel_ingot', ''},
{'', '', ''},
}
})
minetest.register_craft({
output = 'signs_road:blue_right_sign 2',
recipe = {
{'dye:blue', 'dye:white', 'default:steel_ingot'},
{'default:steel_ingot', 'default:steel_ingot', ''},
{'', '', ''},
}
})
minetest.register_craft({
output = 'signs_road:green_right_sign 2',
recipe = {
@ -92,18 +107,95 @@ minetest.register_craft({
minetest.register_craft({
output = 'signs_road:yellow_right_sign 2',
recipe = {
{'dye:yellow', 'dye:white', 'default:steel_ingot'},
{'dye:yellow', 'dye:black', 'default:steel_ingot'},
{'default:steel_ingot', 'default:steel_ingot', ''},
{'', '', ''},
}
})
minetest.register_craft({
output = 'signs_road:white_right_sign 2',
output = 'signs_road:red_right_sign 2',
recipe = {
{'dye:white', 'dye:black', 'default:steel_ingot'},
{'dye:red', 'dye:white', 'default:steel_ingot'},
{'default:steel_ingot', 'default:steel_ingot', ''},
{'', '', ''},
}
})
-- Transform Rectangle <-> Direction
minetest.register_craft({
type = 'shapeless', output = 'signs_road:white_right_sign',
recipe = {'signs_road:white_sign'},
})
minetest.register_craft({
type = 'shapeless', output = 'signs_road:white_sign',
recipe = {'signs_road:white_right_sign'},
})
minetest.register_craft({
type = 'shapeless', output = 'signs_road:blue_right_sign',
recipe = {'signs_road:blue_sign'},
})
minetest.register_craft({
type = 'shapeless', output = 'signs_road:blue_sign',
recipe = {'signs_road:blue_right_sign'},
})
minetest.register_craft({
type = 'shapeless', output = 'signs_road:green_right_sign',
recipe = {'signs_road:green_sign'},
})
minetest.register_craft({
type = 'shapeless', output = 'signs_road:green_sign',
recipe = {'signs_road:green_right_sign'},
})
minetest.register_craft({
type = 'shapeless', output = 'signs_road:yellow_right_sign',
recipe = {'signs_road:yellow_sign'},
})
minetest.register_craft({
type = 'shapeless', output = 'signs_road:yellow_sign',
recipe = {'signs_road:yellow_right_sign'},
})
minetest.register_craft({
type = 'shapeless', output = 'signs_road:red_right_sign',
recipe = {'signs_road:red_sign'},
})
minetest.register_craft({
type = 'shapeless', output = 'signs_road:red_sign',
recipe = {'signs_road:red_right_sign'},
})
-- Various signs
minetest.register_craft({
output = 'signs_road:blue_street_sign 4',
recipe = {
{'dye:blue', 'dye:white', 'dye:blue'},
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
}
})
minetest.register_craft({
output = 'signs_road:red_street_sign 2',
recipe = {
{'dye:white', 'dye:red', 'dye:black'},
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
{'', '', ''},
}
})
minetest.register_craft({
type = "shapeless",
output = 'signs_road:large_street_sign',
recipe = {'signs_road:white_street_sign', 'signs_road:white_street_sign', 'signs_road:white_street_sign', 'signs_road:white_street_sign'},
})

View File

@ -1,6 +1,4 @@
default
intllib?
dye
display_api
font_api
signs_api

4
signs_road/mod.conf Normal file
View File

@ -0,0 +1,4 @@
name=signs_road
description=Various road signs with text display using signs_api
depends=default,dye,signs_api
optional_depends=intllib

View File

@ -33,10 +33,10 @@ local models = {
},
node_fields = {
description = S("Blue street sign"),
tiles = { "signs_road_sides.png", "signs_road_sides.png",
"signs_road_sides.png", "signs_road_sides.png",
"signs_road_sides.png", "signs_road_blue.png" },
inventory_image = "signs_road_blue.png",
tiles = { "signs_road_sides.png", "signs_road_sides.png",
"signs_road_sides.png", "signs_road_sides.png",
"signs_road_sides.png", "signs_road_blue_street.png" },
inventory_image = "signs_road_blue_street.png",
},
},
large_street_sign = {
@ -50,8 +50,8 @@ local models = {
node_fields = {
visual_scale = 1,
description = S("Large banner"),
tiles = { "signs_road_sides.png", "signs_road_sides.png",
"signs_road_sides.png", "signs_road_sides.png",
tiles = { "signs_road_sides.png", "signs_road_sides.png",
"signs_road_sides.png", "signs_road_sides.png",
"signs_road_sides.png", "signs_road_large_white.png" },
inventory_image = "signs_road_white.png",
},
@ -67,13 +67,13 @@ local models = {
},
node_fields = {
description = S("Red and white town sign"),
tiles = { "signs_road_sides.png", "signs_road_sides.png",
"signs_road_sides.png", "signs_road_sides.png",
tiles = { "signs_road_sides.png", "signs_road_sides.png",
"signs_road_sides.png", "signs_road_sides.png",
"signs_road_sides.png", "signs_road_red_white.png" },
inventory_image="signs_road_red_white.png",
},
},
white_street_sign = {
white_sign = {
depth = 1/16,
width = 1,
height = 7/16,
@ -84,13 +84,13 @@ local models = {
},
node_fields = {
description = S("White street sign"),
tiles = { "signs_road_sides.png", "signs_road_sides.png",
"signs_road_sides.png", "signs_road_sides.png",
tiles = { "signs_road_sides.png", "signs_road_sides.png",
"signs_road_sides.png", "signs_road_sides.png",
"signs_road_sides.png", "signs_road_white.png" },
inventory_image = "signs_road_white.png",
},
},
green_street_sign = {
blue_sign = {
depth = 1/16,
width = 1,
height = 7/16,
@ -100,14 +100,31 @@ local models = {
color = "#fff",
},
node_fields = {
description = S("Green street sign"),
tiles = { "signs_road_sides.png", "signs_road_sides.png",
"signs_road_sides.png", "signs_road_sides.png",
description = S("Blue road sign"),
tiles = { "signs_road_sides.png", "signs_road_sides.png",
"signs_road_sides.png", "signs_road_sides.png",
"signs_road_sides.png", "signs_road_blue.png" },
inventory_image = "signs_road_blue.png",
},
},
green_sign = {
depth = 1/16,
width = 1,
height = 7/16,
entity_fields = {
size = { x = 1, y = 6/16 },
maxlines = 2,
color = "#fff",
},
node_fields = {
description = S("Green road sign"),
tiles = { "signs_road_sides.png", "signs_road_sides.png",
"signs_road_sides.png", "signs_road_sides.png",
"signs_road_sides.png", "signs_road_green.png" },
inventory_image = "signs_road_green.png",
},
},
yellow_street_sign = {
yellow_sign = {
depth = 1/16,
width = 1,
height = 7/16,
@ -117,13 +134,30 @@ local models = {
color = "#000",
},
node_fields = {
description = S("Yellow street sign"),
tiles = { "signs_road_sides.png", "signs_road_sides.png",
"signs_road_sides.png", "signs_road_sides.png",
description = S("Yellow road sign"),
tiles = { "signs_road_sides.png", "signs_road_sides.png",
"signs_road_sides.png", "signs_road_sides.png",
"signs_road_sides.png", "signs_road_yellow.png" },
inventory_image="signs_road_yellow.png",
},
},
red_sign = {
depth = 1/16,
width = 1,
height = 7/16,
entity_fields = {
size = { x = 1, y = 6/16 },
maxlines = 2,
color = "#fff",
},
node_fields = {
description = S("Red road sign"),
tiles = { "signs_road_sides.png", "signs_road_sides.png",
"signs_road_sides.png", "signs_road_sides.png",
"signs_road_sides.png", "signs_road_red.png" },
inventory_image = "signs_road_red.png",
},
},
black_right_sign = {
depth = 1/32,
width = 1,
@ -136,8 +170,8 @@ local models = {
},
node_fields = {
description = S("Black direction sign"),
tiles = { "signs_road_sides.png", "signs_road_sides.png",
"signs_road_sides.png", "signs_road_sides.png",
tiles = { "signs_road_sides.png", "signs_road_sides.png",
"signs_road_sides.png", "signs_road_sides.png",
"signs_road_sides.png", "signs_road_black_dir_right.png" },
inventory_image = "signs_road_black_dir_inventory.png",
signs_other_dir = "signs_road:black_left_sign",
@ -157,8 +191,8 @@ local models = {
},
node_fields = {
description = S("Black direction sign"),
tiles = { "signs_road_sides.png", "signs_road_sides.png",
"signs_road_sides.png", "signs_road_sides.png",
tiles = { "signs_road_sides.png", "signs_road_sides.png",
"signs_road_sides.png", "signs_road_sides.png",
"signs_road_sides.png", "signs_road_black_dir_left.png" },
inventory_image = "signs_road_black_dir_inventory.png",
signs_other_dir = "signs_road:black_right_sign",
@ -168,7 +202,102 @@ local models = {
on_rightclick = signs_api.on_right_click_direction,
},
},
white_right_sign = {
depth = 1/16,
width = 14/16,
height = 7/16,
entity_fields = {
right = -3/32,
size = { x = 12/16, y = 6/16 },
maxlines = 2,
color = "#000",
},
node_fields = {
description = S("White direction sign"),
tiles = { "signs_road_white_direction.png" },
inventory_image = "signs_road_white_dir_inventory.png",
signs_other_dir = "signs_road:white_left_sign",
on_place = signs_api.on_place_direction,
on_rightclick = signs_api.on_right_click_direction,
drawtype = "mesh",
mesh = "signs_dir_right.obj",
selection_box = { type = "fixed", fixed = { -0.5, -7/32, 0.5, 7/16, 7/32, 7/16 } },
collision_box = { type = "fixed", fixed = { -0.5, -7/32, 0.5, 7/16, 7/32, 7/16 } },
},
},
white_left_sign = {
depth = 1/16,
width = 14/16,
height = 7/16,
entity_fields = {
right = 3/32,
size = { x = 12/16, y = 6/16 },
maxlines = 2,
color = "#000",
},
node_fields = {
description = S("White direction sign"),
tiles = { "signs_road_white_direction.png" },
inventory_image = "signs_road_white_dir_inventory.png",
signs_other_dir = "signs_road:white_right_sign",
on_place=signs_api.on_place_direction,
on_rightclick = signs_api.on_right_click_direction,
drawtype = "mesh",
mesh = "signs_dir_left.obj",
selection_box = { type = "fixed", fixed = { -7/16, -7/32, 0.5, 0.5, 7/32, 7/16 } },
collision_box = { type = "fixed", fixed = { -7/16, -7/32, 0.5, 0.5, 7/32, 7/16 } },
groups = { not_in_creative_inventory = 1 },
drop = "signs_road:white_right_sign",
},
},
blue_right_sign = {
depth = 1/16,
width = 14/16,
height = 7/16,
entity_fields = {
right = -3/32,
size = { x = 12/16, y = 6/16 },
maxlines = 2,
color = "#fff",
},
node_fields = {
description = S("Blue direction sign"),
tiles = { "signs_road_blue_direction.png" },
inventory_image = "signs_road_blue_dir_inventory.png",
signs_other_dir = "signs_road:blue_left_sign",
on_place = signs_api.on_place_direction,
on_rightclick = signs_api.on_right_click_direction,
drawtype = "mesh",
mesh = "signs_dir_right.obj",
selection_box = { type = "fixed", fixed = { -0.5, -7/32, 0.5, 7/16, 7/32, 7/16 } },
collision_box = { type = "fixed", fixed = { -0.5, -7/32, 0.5, 7/16, 7/32, 7/16 } },
},
},
blue_left_sign = {
depth = 1/16,
width = 14/16,
height = 7/16,
entity_fields = {
right = 3/32,
size = { x = 12/16, y = 6/16 },
maxlines = 2,
color="#fff",
},
node_fields = {
description = S("Blue direction sign"),
tiles = { "signs_road_blue_direction.png" },
inventory_image = "signs_road_blue_dir_inventory.png",
signs_other_dir = "signs_road:blue_right_sign",
on_place = signs_api.on_place_direction,
on_rightclick = signs_api.on_right_click_direction,
drawtype = "mesh",
mesh = "signs_dir_left.obj",
selection_box = { type = "fixed", fixed = { -7/16, -7/32, 0.5, 0.5, 7/32, 7/16 } },
collision_box = { type = "fixed", fixed = { -7/16, -7/32, 0.5, 0.5, 7/32, 7/16 } },
groups = { not_in_creative_inventory = 1 },
drop = "signs_road:blue_right_sign",
},
},
green_right_sign = {
depth = 1/16,
width = 14/16,
@ -265,7 +394,7 @@ local models = {
drop = "signs_road:yellow_right_sign",
},
},
white_right_sign = {
red_right_sign = {
depth = 1/16,
width = 14/16,
height = 7/16,
@ -273,13 +402,13 @@ local models = {
right = -3/32,
size = { x = 12/16, y = 6/16 },
maxlines = 2,
color = "#000",
color = "#fff",
},
node_fields = {
description = S("White direction sign"),
tiles = { "signs_road_white_direction.png" },
inventory_image = "signs_road_white_dir_inventory.png",
signs_other_dir = "signs_road:white_left_sign",
description = S("Red direction sign"),
tiles = { "signs_road_red_direction.png" },
inventory_image = "signs_road_red_dir_inventory.png",
signs_other_dir = "signs_road:red_left_sign",
on_place = signs_api.on_place_direction,
on_rightclick = signs_api.on_right_click_direction,
drawtype = "mesh",
@ -288,7 +417,7 @@ local models = {
collision_box = { type = "fixed", fixed = { -0.5, -7/32, 0.5, 7/16, 7/32, 7/16 } },
},
},
white_left_sign = {
red_left_sign = {
depth = 1/16,
width = 14/16,
height = 7/16,
@ -296,21 +425,21 @@ local models = {
right = 3/32,
size = { x = 12/16, y = 6/16 },
maxlines = 2,
color = "#000",
color = "#fff",
},
node_fields = {
description = S("White direction sign"),
tiles = { "signs_road_white_direction.png" },
inventory_image = "signs_road_white_dir_inventory.png",
signs_other_dir = "signs_road:white_right_sign",
on_place=signs_api.on_place_direction,
description = S("Red direction sign"),
tiles = { "signs_road_red_direction.png" },
inventory_image = "signs_road_red_dir_inventory.png",
signs_other_dir = "signs_road:red_right_sign",
on_place = signs_api.on_place_direction,
on_rightclick = signs_api.on_right_click_direction,
drawtype = "mesh",
mesh = "signs_dir_left.obj",
selection_box = { type = "fixed", fixed = { -7/16, -7/32, 0.5, 0.5, 7/32, 7/16 } },
collision_box = { type = "fixed", fixed = { -7/16, -7/32, 0.5, 0.5, 7/32, 7/16 } },
groups = { not_in_creative_inventory = 1 },
drop = "signs_road:white_right_sign",
drop = "signs_road:red_right_sign",
},
},
}
@ -320,5 +449,3 @@ for name, model in pairs(models)
do
signs_api.register_sign("signs_road", name, model)
end

View File

@ -1,108 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="32px"
height="32px"
id="svg2985"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="green_street.svg"
inkscape:export-filename="/home/pyrollo/dev/minetest-mods/signs/textures/signs_green_street.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90">
<defs
id="defs2987" />
<sodipodi:namedview
id="base"
pagecolor="#d2d038"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:zoom="15.836083"
inkscape:cx="8.8574553"
inkscape:cy="17.483424"
inkscape:current-layer="layer1"
showgrid="true"
inkscape:grid-bbox="true"
inkscape:document-units="px"
inkscape:window-width="1325"
inkscape:window-height="744"
inkscape:window-x="41"
inkscape:window-y="24"
inkscape:window-maximized="1">
<inkscape:grid
type="xygrid"
id="grid2993"
empspacing="2"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true"
spacingx="0.5px"
spacingy="0.5px"
color="#ff0000"
opacity="0.1254902" />
</sodipodi:namedview>
<metadata
id="metadata2990">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Fond"
inkscape:groupmode="layer"
style="display:none">
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#999999;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.30000001;marker:none;enable-background:accumulate"
id="rect3110-2"
width="32"
height="32"
x="0"
y="0"
rx="0"
ry="0"
inkscape:export-filename="/home/pyrollo/dev/minetest-mods/display_modpack/signs_road/textures/signs_road_green_inventory.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90" />
</g>
<g
inkscape:groupmode="layer"
id="layer5"
inkscape:label="Fond inv"
style="display:inline">
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.30000001;marker:none;enable-background:accumulate"
id="rect3110"
width="32"
height="14"
x="0"
y="9"
rx="0"
ry="0" />
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#008040;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.30000001;marker:none;enable-background:accumulate"
id="rect3767"
width="30"
height="12"
x="1"
y="10"
ry="2.4000001"
rx="2" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -1,168 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="32"
height="32"
viewBox="0 0 32 32"
id="svg2"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="signs_green_direction.svg"
inkscape:export-filename="/home/pyrollo/dev/minetest-mods/display_modpack/signs_road/textures/signs_green_direction.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90">
<defs
id="defs4" />
<sodipodi:namedview
id="base"
pagecolor="#e8e285"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:zoom="15.839192"
inkscape:cx="11.800709"
inkscape:cy="20.241354"
inkscape:document-units="px"
inkscape:current-layer="layer2"
showgrid="true"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
units="px"
inkscape:window-width="1325"
inkscape:window-height="744"
inkscape:window-x="41"
inkscape:window-y="24"
inkscape:window-maximized="1">
<inkscape:grid
type="xygrid"
id="grid4147" />
</sodipodi:namedview>
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:groupmode="layer"
id="layer2"
inkscape:label="Texture"
style="display:inline">
<rect
transform="translate(-14.285706,-286.07651)"
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0.98000004;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#999999;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.30000001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
id="rect4192"
width="32"
height="32"
x="14.285706"
y="286.07651" />
<path
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.30000001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="m 2,18 0,14 30,0 0,-10 -2,0 0,-4 -28,0 z"
id="rect4164-7"
inkscape:connector-curvature="0" />
<path
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.30000001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="m 2,2 0,14 28,0 0,-4 2,0 L 32,2 2,2 Z"
id="rect4164"
inkscape:connector-curvature="0" />
<path
style="fill:#008040;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 3,3 22,0 4,6 -4,6 -22,0 z"
id="path4234"
inkscape:connector-curvature="0" />
<path
style="fill:#008040;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 3,19 22,0 4,6 -4,6 -22,0 z"
id="path4234-5"
inkscape:connector-curvature="0" />
</g>
<g
inkscape:groupmode="layer"
id="layer3"
inkscape:label="Inventory"
style="display:none">
<path
style="display:inline;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 2,10 0,14 24,0 6,-7 -6,-7 z"
id="path4212-3"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccc" />
<path
style="display:inline;fill:#008040;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 3,11 22,0 4,6 -4,6 -22,0 z"
id="path4234-5-5"
inkscape:connector-curvature="0" />
</g>
<g
inkscape:label="Guides"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-14.285706,-286.07651)"
style="display:none">
<rect
style="fill:none;stroke:#ff00ff;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4149"
width="1.9999995"
height="13.999997"
x="14.285706"
y="288.07651" />
<rect
style="fill:none;stroke:#ff00ff;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4149-3"
width="2.0000005"
height="10.000003"
x="44.285706"
y="298.07651" />
<rect
style="fill:none;stroke:#ff00ff;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4149-3-6"
width="24"
height="1.9999976"
x="16.285706"
y="302.07651" />
<rect
style="fill:none;stroke:#ff00ff;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4149-3-7"
width="2.0000005"
height="10.000003"
x="14.285706"
y="308.07651" />
<rect
style="fill:none;stroke:#ff00ff;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4149-3-5"
width="24"
height="2.0000024"
x="16.285706"
y="286.07651" />
<path
style="fill:none;fill-rule:evenodd;stroke:#ff00ff;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 16.285706,288.07651 24,0 6,7 -6,7 -24,0 z"
id="path4193"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccc" />
<path
style="fill:none;fill-rule:evenodd;stroke:#ff00ff;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 16.285706,304.07651 0,14 24,0 6,-7 -6,-7 z"
id="path4212"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccc" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 7.5 KiB

View File

@ -1,172 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="32"
height="32"
viewBox="0 0 32 32"
id="svg2"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="signs_road_black_direction.svg"
inkscape:export-filename="/home/pyrollo/dev/minetest-mods/display_modpack/signs_road/textures/signs_road_black_dir_inventory.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90">
<defs
id="defs4" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:zoom="7.919596"
inkscape:cx="0.60099162"
inkscape:cy="14.877077"
inkscape:document-units="px"
inkscape:current-layer="layer3"
showgrid="true"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
units="px"
inkscape:window-width="1325"
inkscape:window-height="744"
inkscape:window-x="41"
inkscape:window-y="24"
inkscape:window-maximized="1">
<inkscape:grid
type="xygrid"
id="grid4147" />
</sodipodi:namedview>
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Guides"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-14.285706,-286.07651)"
style="display:none"
sodipodi:insensitive="true">
<rect
style="fill:none;stroke:#ff00ff;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4149"
width="1.9999995"
height="13.999997"
x="14.285706"
y="288.07651" />
<rect
style="fill:none;stroke:#ff00ff;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4149-3"
width="2.0000005"
height="10.000003"
x="44.285706"
y="298.07651" />
<rect
style="fill:none;stroke:#ff00ff;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4149-3-6"
width="24"
height="1.9999976"
x="16.285706"
y="302.07651" />
<rect
style="fill:none;stroke:#ff00ff;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4149-3-7"
width="2.0000005"
height="10.000003"
x="14.285706"
y="308.07651" />
<rect
style="fill:none;stroke:#ff00ff;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4149-3-5"
width="24"
height="2.0000024"
x="16.285706"
y="286.07651" />
<path
style="fill:none;fill-rule:evenodd;stroke:#ff00ff;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 16.285706,288.07651 24,0 6,7 -6,7 -24,0 z"
id="path4193"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccc" />
<path
style="fill:none;fill-rule:evenodd;stroke:#ff00ff;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 16.285706,304.07651 0,14 24,0 6,-7 -6,-7 z"
id="path4212"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccc" />
</g>
<g
inkscape:groupmode="layer"
id="layer3"
inkscape:label="Inventory"
style="display:none">
<path
style="display:inline;fill:#000000;fill-rule:evenodd;stroke:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 1,10 24,0 6,7 -6,7 -24,0 z"
id="path4193-3-3"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccc" />
<path
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 2,11 22,0 4,6 -4,6 -22,0 z"
id="path4234-6"
inkscape:connector-curvature="0" />
</g>
<g
inkscape:groupmode="layer"
id="layer2"
inkscape:label="Texture"
style="display:inline">
<rect
style="fill:#808080;stroke:none;stroke-width:2;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4147"
width="32"
height="32"
x="0"
y="0" />
<path
transform="translate(-14.285706,-286.07651)"
style="display:inline;fill:#000000;fill-rule:evenodd;stroke:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 16.285706,288.07651 24,0 6,7 -6,7 -24,0 z"
id="path4193-3"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccc" />
<path
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 3,3 22,0 4,6 -4,6 -22,0 z"
id="path4234"
inkscape:connector-curvature="0" />
<path
transform="translate(-14.285706,-286.07651)"
style="display:inline;fill:#000000;fill-rule:evenodd;stroke:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 16.285706,304.07651 0,14 24,0 6,-7 -6,-7 z"
id="path4212-6"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccc" />
<path
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 3,19 22,0 4,6 -4,6 -22,0 z"
id="path4234-5"
inkscape:connector-curvature="0" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 6.5 KiB

View File

@ -0,0 +1,316 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="32"
height="32"
viewBox="0 0 32 32"
id="svg2"
version="1.1"
inkscape:version="0.92.3 (2405546, 2018-03-11)"
sodipodi:docname="signs_road_direction.svg"
inkscape:export-filename="/home/pyrollo/dev/minetest-mods/display_modpack/signs_road/textures/signs_road_blue_direction.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96">
<defs
id="defs4" />
<sodipodi:namedview
id="base"
pagecolor="#e8e285"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:zoom="11.2"
inkscape:cx="9.0886289"
inkscape:cy="9.9967465"
inkscape:document-units="px"
inkscape:current-layer="layer4"
showgrid="true"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
units="px"
inkscape:window-width="1323"
inkscape:window-height="713"
inkscape:window-x="43"
inkscape:window-y="27"
inkscape:window-maximized="1"
inkscape:measure-start="20,25"
inkscape:measure-end="0,0">
<inkscape:grid
type="xygrid"
id="grid4147" />
</sodipodi:namedview>
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:groupmode="layer"
id="layer5"
inkscape:label="Texture Background"
style="display:none">
<image
y="0"
x="0"
id="image4617"
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBI WXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH4QgZBgMAIw0eIgAAA8hJREFUWMPFls+KJEUQxn8RlVlV vYPsCuI77Hrd8zoexfP6CoIXfYPFBxAEwYfQk4hnvXiZ0zKjCz6CIKizO931JzPCQ1XWVI894sHp DWi6OjqyIuKLzO9LYbbnz5+7iDD2mXttxdUwkMbMOA48ePAmAGaZru9QUZSwFweQbfre7a7YbE4Y +p4QAgBPnjwRDlgoD6oVZhnXzJ9XHWYOQNu2mGVEBNWKpm7ouh6J+3HFhr6n0um17abFzElp5DaT Fy9+cYCHDx9xDBMR+QcCee5CPnvvTpJ+/fQZTx+dHvxPszl+A8b/2z7+/gt+u/oDAJ9tKaBSuXPY f9/+xUfffX47Asewb3/9iW9e/Lj8LkiomyNHQOHmKBYEQlDSOBylgEOj0JSMEGuOZU2I+wUAR0Pg rXv3+fL9T/YLcD8eAl998ClvnzzYp2IzO0ryD9853SOji4ufJwREhLsu4hD0OaepgMvLS6oqHA16 ma1patyNUNQOwJ/9cLTTkJJhZsjrug+cnZ15jPH13QfMjXEcrwsIQQGlriMp2azVBnMHxddUSnP/ jT1fiUvJ2IarySc1salYI5xS4vHjxwIsjeiyK+dOlruBypL8v/rKiwFcM+6OiDLMRLdSYQA2m/Z6 D5yfX7ioUMSpyHS5L6x9pfObvpwT/dBTVRUxRFQnBIZxwHImxsiu26Gqyz7S9QjcnLU4pWRLAjeH lFjHr+MAmqZm026IM99vd/M4qmqZebfrMDNyNlwzcn5+4etuUjIKEsX/bwgcuk2520JuIsJu1+EY qjqvz/PGF7Qwkpsvc3318tUEm+WDycuaddw6+fKcBtydfuiWzs2MECpSGjFztDBSSeZutG0DWXD3 W6G+Gedu88dxSYQY6ZPTDz0hROqmodt1qCopZUKIqAqhMFIhGnefgnQgZahSIMR6Sb5msXVclGud HwfDqxHHyMmptEIUoFkQ6LpuKqLrdgD0Qz8fm0mc6lgjMs9sHAhBMcsM40BZs44bhgnuWgUVYbvd YuY0TU2I1ZLYzKfiRUlpRMvubOqGfugp4iSihKqi3BdSmuBd7+h1XPH12ei6HgRCqAhVwM2XxGX2 5lMRoTBSjBOJqOge9ZYNV8ikqduFxQ5RNIz4pPM0dUPKia7rMDfCfDwtZ07fPZXlSrbZtMsRqesa dycP3ZJgDXWBf7Np9+KyGaITxzdNjaCknBjHcb546KIJtjopYRxHlECoFVW9VsOs9LtuTw1DVdGl kbJmHbdWw5cvL9lsTthdbhc1LJDfVMWQsyExoxrvXA3XnRf7G4ElQvNOekeUAAAAAElFTkSuQmCC "
style="stroke-width:1.0666666;image-rendering:optimizeSpeed"
preserveAspectRatio="none"
height="32"
width="32" />
</g>
<g
inkscape:groupmode="layer"
id="layer2"
inkscape:label="Black Border"
style="display:none">
<path
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.30000001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="m 2,2 v 14 h 28 v -4 h 2 V 2 Z"
id="rect4164"
inkscape:connector-curvature="0" />
</g>
<g
style="display:none"
inkscape:label="White Border"
id="g1256"
inkscape:groupmode="layer">
<path
inkscape:connector-curvature="0"
id="path1254"
d="m 2,2 v 14 h 28 v -4 h 2 V 2 Z"
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.30000001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
</g>
<g
inkscape:groupmode="layer"
id="layer4"
inkscape:label="Yellow Background"
style="display:none">
<path
style="display:inline;fill:#fbdf00;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 3,3 h 22 l 4,6 -4,6 H 3 Z"
id="path4234"
inkscape:connector-curvature="0" />
</g>
<g
style="display:none"
inkscape:label="Green Background"
id="g1268"
inkscape:groupmode="layer">
<path
inkscape:connector-curvature="0"
id="path1264"
d="m 3,3 h 22 l 4,6 -4,6 H 3 Z"
style="display:inline;fill:#008040;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
</g>
<g
inkscape:groupmode="layer"
id="g1280"
inkscape:label="Blue Background"
style="display:none">
<path
style="display:inline;fill:#0040c0;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 3,3 h 22 l 4,6 -4,6 H 3 Z"
id="path1276"
inkscape:connector-curvature="0" />
</g>
<g
inkscape:groupmode="layer"
id="g1274"
inkscape:label="Red Background"
style="display:none">
<path
style="display:inline;fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 3,3 h 22 l 4,6 -4,6 H 3 Z"
id="path1270"
inkscape:connector-curvature="0" />
</g>
<g
style="display:none"
inkscape:label="White Background"
id="g1262"
inkscape:groupmode="layer">
<path
inkscape:connector-curvature="0"
id="path1258"
d="m 3,3 h 22 l 4,6 -4,6 H 3 Z"
style="display:inline;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path1260"
d="m 3,19 h 22 l 4,6 -4,6 H 3 Z"
style="display:inline;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
</g>
<g
inkscape:groupmode="layer"
id="layer3"
inkscape:label="Inventory Black Border"
style="display:none">
<path
style="display:inline;fill:#000000;fill-rule:evenodd;stroke:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 2,10 v 14 h 24 l 6,-7 -6,-7 z"
id="path4212-3"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccc" />
</g>
<g
style="display:inline"
inkscape:label="Inventory White Border"
id="g854"
inkscape:groupmode="layer">
<path
sodipodi:nodetypes="cccccc"
inkscape:connector-curvature="0"
id="path852"
d="m 2,10 v 14 h 24 l 6,-7 -6,-7 z"
style="display:inline;fill:#ffffff;fill-rule:evenodd;stroke:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</g>
<g
style="display:none"
inkscape:label="Inventory Yellow Background"
id="g850"
inkscape:groupmode="layer">
<path
inkscape:connector-curvature="0"
id="path848"
d="m 3,11 h 22 l 4,6 -4,6 H 3 Z"
style="display:inline;fill:#fbdf00;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
</g>
<g
inkscape:groupmode="layer"
id="g870"
inkscape:label="Inventory Green Background"
style="display:inline">
<path
style="display:inline;fill:#008040;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 3,11 h 22 l 4,6 -4,6 H 3 Z"
id="path868"
inkscape:connector-curvature="0" />
</g>
<g
inkscape:groupmode="layer"
id="g866"
inkscape:label="Inventory Blue Background"
style="display:none">
<path
style="display:inline;fill:#0040c0;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 3,11 h 22 l 4,6 -4,6 H 3 Z"
id="path864"
inkscape:connector-curvature="0" />
</g>
<g
inkscape:groupmode="layer"
id="g862"
inkscape:label="Inventory Red Background"
style="display:none">
<path
style="display:inline;fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 3,11 h 22 l 4,6 -4,6 H 3 Z"
id="path860"
inkscape:connector-curvature="0" />
</g>
<g
inkscape:groupmode="layer"
id="g858"
inkscape:label="Inventory White Background"
style="display:none">
<path
style="display:inline;fill:#fbdf00;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 3,11 h 22 l 4,6 -4,6 H 3 Z"
id="path856"
inkscape:connector-curvature="0" />
</g>
<g
inkscape:label="Guides"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-14.285706,-286.07651)"
style="display:none">
<rect
style="fill:none;stroke:#ff00ff;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4149"
width="1.9999995"
height="13.999997"
x="14.285706"
y="288.07651" />
<rect
style="fill:none;stroke:#ff00ff;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4149-3"
width="2.0000005"
height="10.000003"
x="44.285706"
y="298.07651" />
<rect
style="fill:none;stroke:#ff00ff;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4149-3-6"
width="24"
height="1.9999976"
x="16.285706"
y="302.07651" />
<rect
style="fill:none;stroke:#ff00ff;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4149-3-7"
width="2.0000005"
height="10.000003"
x="14.285706"
y="308.07651" />
<rect
style="fill:none;stroke:#ff00ff;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4149-3-5"
width="24"
height="2.0000024"
x="16.285706"
y="286.07651" />
<path
style="fill:none;fill-rule:evenodd;stroke:#ff00ff;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 16.285706,288.07651 h 24 l 6,7 -6,7 h -24 z"
id="path4193"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccc" />
<path
style="fill:none;fill-rule:evenodd;stroke:#ff00ff;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 16.285706,304.07651 v 14 h 24 l 6,-7 -6,-7 z"
id="path4212"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccc" />
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:1.33333337px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="14.285706"
y="279.07651"
id="text874"><tspan
sodipodi:role="line"
id="tspan872"
x="14.285706"
y="279.07651">Inventory: export page to 32x32 png</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:1.33333337px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;display:inline;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="14.285706"
y="281.07651"
id="text874-2"><tspan
sodipodi:role="line"
id="tspan872-8"
x="14.285706"
y="281.07651">Texture: export page to 32x32 png</tspan></text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -0,0 +1,188 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="32px"
height="32px"
id="svg2985"
version="1.1"
inkscape:version="0.92.3 (2405546, 2018-03-11)"
sodipodi:docname="signs_road_rectangle.svg"
inkscape:export-filename="/home/pyrollo/dev/minetest-mods/display_modpack/signs_road/textures/signs_road_red.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96">
<defs
id="defs2987" />
<sodipodi:namedview
id="base"
pagecolor="#d2d038"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:zoom="15.836083"
inkscape:cx="0.23789952"
inkscape:cy="17.483424"
inkscape:current-layer="layer5"
showgrid="true"
inkscape:grid-bbox="true"
inkscape:document-units="px"
inkscape:window-width="1323"
inkscape:window-height="713"
inkscape:window-x="43"
inkscape:window-y="27"
inkscape:window-maximized="1">
<inkscape:grid
type="xygrid"
id="grid2993"
empspacing="2"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true"
spacingx="0.5"
spacingy="0.5"
color="#ff0000"
opacity="0.1254902"
originx="0"
originy="0" />
</sodipodi:namedview>
<metadata
id="metadata2990">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:groupmode="layer"
id="layer5"
inkscape:label="Black Border"
style="display:inline">
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.30000001;marker:none;enable-background:accumulate"
id="rect3110"
width="32"
height="14"
x="0"
y="9"
rx="0"
ry="0" />
</g>
<g
style="display:inline"
inkscape:label="White Border"
id="g901"
inkscape:groupmode="layer">
<rect
ry="0"
rx="0"
y="9"
x="0"
height="14"
width="32"
id="rect899"
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.30000001;marker:none;enable-background:accumulate" />
</g>
<g
style="display:inline"
inkscape:label="Blue Background"
id="g897"
inkscape:groupmode="layer">
<rect
rx="2"
ry="2.4000001"
y="10"
x="1"
height="12"
width="30"
id="rect895"
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#0040c0;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.30000001;marker:none;enable-background:accumulate" />
</g>
<g
inkscape:groupmode="layer"
id="g917"
inkscape:label="Green Background"
style="display:inline">
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#008040;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.30000001;marker:none;enable-background:accumulate"
id="rect915"
width="30"
height="12"
x="1"
y="10"
ry="2.4000001"
rx="2" />
</g>
<g
inkscape:groupmode="layer"
id="g905"
inkscape:label="Yellow Background"
style="display:none">
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#fbdf00;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.30000001;stroke-miterlimit:4;stroke-dasharray:none;marker:none;enable-background:accumulate"
id="rect903"
width="30"
height="12"
x="1"
y="10"
ry="2.4000001"
rx="2" />
</g>
<g
style="display:none"
inkscape:label="Red Background"
id="g909"
inkscape:groupmode="layer">
<rect
rx="2"
ry="2.4000001"
y="10"
x="1"
height="12"
width="30"
id="rect907"
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#ff0000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.30000001;marker:none;enable-background:accumulate" />
</g>
<g
inkscape:groupmode="layer"
id="g913"
inkscape:label="White Background"
style="display:none">
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.30000001;marker:none;enable-background:accumulate"
id="rect911"
width="30"
height="12"
x="1"
y="10"
ry="2.4000001"
rx="2" />
</g>
<g
inkscape:groupmode="layer"
id="layer1"
inkscape:label="Red Frame"
style="display:none">
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1.02928686;stroke-miterlimit:4;stroke-dasharray:none;marker:none;enable-background:accumulate"
id="rect3767-5"
width="28.970713"
height="10.970714"
x="1.5146437"
y="10.514643"
ry="2.1941426"
rx="1.9313809" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.7 KiB

View File

@ -1,123 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="32px"
height="32px"
id="svg2985"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="signs_road_red.svg"
inkscape:export-filename="/home/pyrollo/dev/minetest-mods/display_modpack/signs_road/textures/signs_road_red_inventory.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90">
<defs
id="defs2987" />
<sodipodi:namedview
id="base"
pagecolor="#f9f6c0"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:zoom="11.197802"
inkscape:cx="11.734227"
inkscape:cy="23.110862"
inkscape:current-layer="layer5"
showgrid="true"
inkscape:grid-bbox="true"
inkscape:document-units="px"
inkscape:window-width="1325"
inkscape:window-height="744"
inkscape:window-x="41"
inkscape:window-y="24"
inkscape:window-maximized="1">
<inkscape:grid
type="xygrid"
id="grid2993"
empspacing="2"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true"
spacingx="0.5px"
spacingy="0.5px"
color="#ff0000"
opacity="0.1254902" />
</sodipodi:namedview>
<metadata
id="metadata2990">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Texture"
inkscape:groupmode="layer"
style="display:none">
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.30000001;marker:none;enable-background:accumulate"
id="rect3110-2"
width="32"
height="32"
x="0"
y="0"
rx="0"
ry="0" />
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.30000001;marker:none;enable-background:accumulate"
id="rect3110"
width="32"
height="14"
x="0"
y="9"
rx="0"
ry="0" />
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1.02928686;stroke-miterlimit:4;stroke-dasharray:none;marker:none;enable-background:accumulate"
id="rect3767"
width="28.970713"
height="10.970714"
x="1.5146434"
y="10.514644"
ry="2.1941426"
rx="1.9313809" />
</g>
<g
inkscape:groupmode="layer"
id="layer5"
inkscape:label="Inventory"
style="display:inline">
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.30000001;marker:none;enable-background:accumulate"
id="rect3110-7"
width="32"
height="14"
x="0"
y="9"
rx="0"
ry="0" />
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1.02928686;stroke-miterlimit:4;stroke-dasharray:none;marker:none;enable-background:accumulate"
id="rect3767-5"
width="28.970713"
height="10.970714"
x="1.5146434"
y="10.514644"
ry="2.1941426"
rx="1.9313809" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 4.0 KiB

View File

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

@ -1,168 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="32"
height="32"
viewBox="0 0 32 32"
id="svg2"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="signs_yellow_direction.svg"
inkscape:export-filename="/home/pyrollo/dev/minetest-mods/display_modpack/signs_road/textures/signs_road_yellow_direction.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90">
<defs
id="defs4" />
<sodipodi:namedview
id="base"
pagecolor="#e8e285"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:zoom="15.839192"
inkscape:cx="12.242651"
inkscape:cy="20.241354"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
units="px"
inkscape:window-width="1325"
inkscape:window-height="744"
inkscape:window-x="41"
inkscape:window-y="24"
inkscape:window-maximized="1">
<inkscape:grid
type="xygrid"
id="grid4147" />
</sodipodi:namedview>
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:groupmode="layer"
id="layer2"
inkscape:label="Texture"
style="display:inline">
<rect
transform="translate(-14.285706,-286.07651)"
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0.98000004;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#999999;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.30000001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
id="rect4192"
width="32"
height="32"
x="14.285706"
y="286.07651" />
<path
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.30000001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="m 2,18 0,14 30,0 0,-10 -2,0 0,-4 -28,0 z"
id="rect4164-7"
inkscape:connector-curvature="0" />
<path
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.30000001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="m 2,2 0,14 28,0 0,-4 2,0 L 32,2 2,2 Z"
id="rect4164"
inkscape:connector-curvature="0" />
<path
style="fill:#fbdf00;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 3,3 22,0 4,6 -4,6 -22,0 z"
id="path4234"
inkscape:connector-curvature="0" />
<path
style="fill:#fbdf00;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 3,19 22,0 4,6 -4,6 -22,0 z"
id="path4234-5"
inkscape:connector-curvature="0" />
</g>
<g
inkscape:groupmode="layer"
id="layer3"
inkscape:label="Inventory"
style="display:none">
<path
style="display:inline;fill:#000000;fill-rule:evenodd;stroke:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 2,10 0,14 24,0 6,-7 -6,-7 z"
id="path4212-3"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccc" />
<path
style="display:inline;fill:#fbdf00;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 3,11 22,0 4,6 -4,6 -22,0 z"
id="path4234-5-5"
inkscape:connector-curvature="0" />
</g>
<g
inkscape:label="Guides"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-14.285706,-286.07651)"
style="display:none">
<rect
style="fill:none;stroke:#ff00ff;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4149"
width="1.9999995"
height="13.999997"
x="14.285706"
y="288.07651" />
<rect
style="fill:none;stroke:#ff00ff;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4149-3"
width="2.0000005"
height="10.000003"
x="44.285706"
y="298.07651" />
<rect
style="fill:none;stroke:#ff00ff;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4149-3-6"
width="24"
height="1.9999976"
x="16.285706"
y="302.07651" />
<rect
style="fill:none;stroke:#ff00ff;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4149-3-7"
width="2.0000005"
height="10.000003"
x="14.285706"
y="308.07651" />
<rect
style="fill:none;stroke:#ff00ff;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4149-3-5"
width="24"
height="2.0000024"
x="16.285706"
y="286.07651" />
<path
style="fill:none;fill-rule:evenodd;stroke:#ff00ff;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 16.285706,288.07651 24,0 6,7 -6,7 -24,0 z"
id="path4193"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccc" />
<path
style="fill:none;fill-rule:evenodd;stroke:#ff00ff;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 16.285706,304.07651 0,14 24,0 6,-7 -6,-7 z"
id="path4212"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccc" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 7.5 KiB

View File

@ -1,110 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="32px"
height="32px"
id="svg2985"
version="1.1"
inkscape:version="0.92.1 r15371"
sodipodi:docname="white_street.svg"
inkscape:export-filename="/home/pyrollo/dev/minetest-mods/display_modpack/signs_road/textures/signs_road_yellow_inventory.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90">
<defs
id="defs2987" />
<sodipodi:namedview
id="base"
pagecolor="#d2d038"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:zoom="15.836083"
inkscape:cx="-5.5084709"
inkscape:cy="17.483424"
inkscape:current-layer="layer5"
showgrid="true"
inkscape:grid-bbox="true"
inkscape:document-units="px"
inkscape:window-width="1325"
inkscape:window-height="744"
inkscape:window-x="41"
inkscape:window-y="24"
inkscape:window-maximized="1">
<inkscape:grid
type="xygrid"
id="grid2993"
empspacing="2"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true"
spacingx="0.5"
spacingy="0.5"
color="#ff0000"
opacity="0.1254902"
originx="0"
originy="0" />
</sodipodi:namedview>
<metadata
id="metadata2990">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Fond"
inkscape:groupmode="layer"
style="display:none">
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#999999;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.30000001;marker:none;enable-background:accumulate"
id="rect3110-2"
width="32"
height="32"
x="0"
y="0"
rx="0"
ry="0"
inkscape:export-filename="/home/pyrollo/dev/minetest-mods/display_modpack/signs_road/textures/signs_road_green_inventory.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90" />
</g>
<g
inkscape:groupmode="layer"
id="layer5"
inkscape:label="Fond inv"
style="display:inline">
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.30000001;marker:none;enable-background:accumulate"
id="rect3110"
width="32"
height="14"
x="0"
y="9"
rx="0"
ry="0" />
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.30000001;marker:none;enable-background:accumulate"
id="rect3767"
width="30"
height="12"
x="1"
y="10"
ry="2.4000001"
rx="2" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 3.4 KiB

View File

@ -1,108 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="32px"
height="32px"
id="svg2985"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="yellow_street.svg"
inkscape:export-filename="/home/pyrollo/dev/minetest-mods/display_modpack/signs_road/textures/signs_road_yellow_inventory.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90">
<defs
id="defs2987" />
<sodipodi:namedview
id="base"
pagecolor="#d2d038"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:zoom="15.836083"
inkscape:cx="8.8574553"
inkscape:cy="17.483424"
inkscape:current-layer="layer5"
showgrid="true"
inkscape:grid-bbox="true"
inkscape:document-units="px"
inkscape:window-width="1325"
inkscape:window-height="744"
inkscape:window-x="41"
inkscape:window-y="24"
inkscape:window-maximized="1">
<inkscape:grid
type="xygrid"
id="grid2993"
empspacing="2"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true"
spacingx="0.5px"
spacingy="0.5px"
color="#ff0000"
opacity="0.1254902" />
</sodipodi:namedview>
<metadata
id="metadata2990">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Fond"
inkscape:groupmode="layer"
style="display:none">
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#999999;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.30000001;marker:none;enable-background:accumulate"
id="rect3110-2"
width="32"
height="32"
x="0"
y="0"
rx="0"
ry="0"
inkscape:export-filename="/home/pyrollo/dev/minetest-mods/display_modpack/signs_road/textures/signs_road_green_inventory.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90" />
</g>
<g
inkscape:groupmode="layer"
id="layer5"
inkscape:label="Fond inv"
style="display:inline">
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.30000001;marker:none;enable-background:accumulate"
id="rect3110"
width="32"
height="14"
x="0"
y="9"
rx="0"
ry="0" />
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#fbdf00;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.30000001;marker:none;enable-background:accumulate"
id="rect3767"
width="30"
height="12"
x="1"
y="10"
ry="2.4000001"
rx="2" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 436 B

After

Width:  |  Height:  |  Size: 302 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 377 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 436 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

4
steles/mod.conf Normal file
View File

@ -0,0 +1,4 @@
name=steles
description=Stone steles with text display on them
depends=default,display_api,font_api
optional_depends=intllib,technic

View File

@ -30,7 +30,7 @@ for i, material in ipairs(steles.materials) do
if ndef then
local groups = table.copy(ndef.groups)
local parts = material:split(":")
groups.display_modpack_node = 1
groups.display_api = 1
minetest.register_node("steles:"..parts[2].."_stele", {
description = steles.materials_desc[i],
@ -50,7 +50,7 @@ for i, material in ipairs(steles.materials) do
display_entities = {
["steles:text"] = {
on_display_update = font_api.on_display_update,
depth = -2/16 - display_api.entity_spacing,
depth = -2/16 - display_api.entity_spacing,
top = -2/16,
aspect_ratio = 0.4,
size = { x = 10/16, y = 12/16 },
@ -63,12 +63,14 @@ for i, material in ipairs(steles.materials) do
end,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec", "size[6,4]"
..default.gui_bg .. default.gui_bg_img .. default.gui_slots
.."textarea[0.5,0.7;5.5,2;display_text;"
..F("Displayed text (3 lines max)")
..";${display_text}]"
.."button_exit[2,3;2,1;ok;"..F("Write").."]")
meta:set_string("formspec", string.format([=[
size[6,4]%s%s%s
textarea[0.5,0.7;5.5,2;display_text;%s;${display_text}]
button[1,3;2,1;font;%s]
button_exit[3,3;2,1;ok;%s]]=],
default.gui_bg, default.gui_bg_img, default.gui_slots,
F("Displayed text (3 lines max)"),
F("Font"), F("Write")))
display_api.on_construct(pos)
end,
on_destruct = display_api.on_destruct,
@ -76,15 +78,17 @@ for i, material in ipairs(steles.materials) do
on_receive_fields = function(pos, formname, fields, player)
if not minetest.is_protected(pos, player:get_player_name()) then
local meta = minetest.get_meta(pos)
if fields and fields.ok then
if fields.ok or fields.font then
meta:set_string("display_text", fields.display_text)
meta:set_string("infotext", "\""..fields.display_text.."\"")
display_api.update_entities(pos)
end
if fields.font then
font_api.show_font_list(player, pos)
end
end
end,
on_punch = display_api.update_entities,
})
end
end