Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F63386201
text_field.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, May 19, 18:34
Size
1 KB
Mime Type
text/x-python
Expires
Tue, May 21, 18:34 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
17767211
Attached To
rNIETZSCHEPYTHON nietzsche-python
text_field.py
View Options
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" This class represents a text field on a faksimile svg.
"""
# Copyright (C) University of Basel 2019 {{{1
#
# 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 <https://www.gnu.org/licenses/> 1}}}
import
sys
import
re
from
os
import
path
,
sep
import
lxml.etree
as
ET
from
.positional_object
import
PositionalObject
__author__
=
"Christian Steiner"
__maintainer__
=
__author__
__copyright__
=
'University of Basel'
__email__
=
"christian.steiner@unibas.ch"
__status__
=
"Development"
__version__
=
"0.0.1"
class
TextField
(
PositionalObject
):
"""
This class represents the text field of a faksimile svg.
Args:
id (str): id from svg file.
width (float)
height (float)
x (float)
y (float)
"""
XML_TAG
=
'text-field'
def
__init__
(
self
,
id
=
None
,
node
=
None
,
width
=
0.0
,
height
=
0.0
,
x
=
0.0
,
y
=
0.0
):
super
(
TextField
,
self
)
.
__init__
(
node
=
node
,
id
=
id
,
width
=
width
,
height
=
height
,
x
=
x
,
y
=
y
,
tag
=
self
.
XML_TAG
)
self
.
xmin
=
self
.
left
self
.
xmax
=
self
.
left
+
self
.
width
self
.
ymin
=
self
.
top
self
.
ymax
=
self
.
top
+
self
.
height
Event Timeline
Log In to Comment