Nevron Forum
Home
»
Nevron Open Vision for NET
»
NOV Diagram for .NET
»
How to set font size and style for each shape file
Login
Register
Login
Register
Home
»
Nevron Open Vision for NET
»
NOV Diagram for .NET
»
How to set font size and style for each shape file
How to set font size and style for each shape file
Post Reply
How
to
set
font
size
and
style
for
each
shape
file
View
Flat Ascending
Flat Descending
Threaded
Options
Subscribe to topic
Print This Topic
Goto Topics Forum
Author
Message
Kirk Kanjian
Kirk Kanjian
posted 3 Years Ago
ANSWER
Topic Details
Group: Forum Members
Posts: 8,
Visits: 18
Hi
I
am
using
Nevron
diagram
and
trying
to
set
Font
size
and
style
for
each
shape
.
But
it
is
taking
the
last
shape
style
for
the
entire
renderings
.
Please
let
me
know
how
to
set
font
styles
for
each
shape
Code
used
for
setting
font
style
for
each
shape
:
For
Each
s
As
NShape
In
&#
100
;
ocument
.
Descendants
(
NFilters
.
Shape2D
, -
1
)
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
If
Not
IsNothing
(
s
.
Tag
)
Then
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
Dim
roomInfo
As
RoomInfo
=
s
.
Tag
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
Dim
roomNumber
As
String
=
roomInfo
.
RoomNumber
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
Dim
customFontSize
as
Single
=
roomInfo
.
CustomFontSize
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
Dim
textSize
As
Single
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
If
Not
String
.
IsNullOrEmpty
(
customFontSize
)
Then
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
textSize
=
Convert
.
ToSingle
(
customFontSize
)
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
Dim
textStyle
As
New
NTextStyle
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
textStyle
=
s
.
ComposeTextStyle
()
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
textStyle
.
FontStyle
=
New
NFontStyle
("
Arial
",
textSize
)
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
NStyle
.
SetTextStyle
(
s
,
textStyle
)
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
End
If
&
nbsp
; &
nbsp
;
End
If
&
nbsp
;&
nbsp
;
Next
Reply
Like
0
Nevron Support
Nevron Support
posted 3 Years Ago
ANSWER
Post Details
Group: Administrators
Posts: 3.1K,
Visits: 4.1K
Hi
,
By
default
the
composed
text
style
is
the
text
style
of
the
drawing
document
and
every
change
changes
it
directly
.
That
is
why
the
style
of
the
last
shape
is
applied
to
the
document
'
s
text
style
and
then
to
all
other
shapes
.
To
avoid
this
issue
,
you
should
clone
the
composed
text
style
and
then
modify
the
cloned
version
.
Here
'
s
how
to
clone
it
:
Dim
textStyle
As
NTextStyle
=
CType
(
s
.
ComposeTextStyle
().
Clone
(),
NTextStyle
)
To
save
memory
and
improve
performance
we
recommend
you
clone
and
apply
a
text
style
only
to
shapes
whose
text
style
should
be
different
from
the
text
style
of
the
drawing
&#
100
;
ocument
.
Best Regards,
Nevron Support Team
Reply
Like
0
Kirk Kanjian
Kirk Kanjian
posted 3 Years Ago
ANSWER
Post Details
Group: Forum Members
Posts: 8,
Visits: 18
Hi
,
I
implemented
the
code
and
cloned
the
shapefile
style
.
But
still
i
am
seeing
no
difference
in
the
text
size
for
each
shape
file
.
Please
let
me
know
what
i
am
missing
.
For
Each
s
As
NShape
In
&#
100
;
ocument
.
Descendants
(
NFilters
.
Shape2D
, -
1
)
&
nbsp
;&
nbsp
;
If
Not
IsNothing
(
s
.
Tag
)
Then
&
nbsp
;&
nbsp
;&
nbsp
;
Dim
roomInfo
As
RoomInfo
=
s
.
Tag
&
nbsp
;&
nbsp
;&
nbsp
;
Dim
roomNumber
As
String
=
roomInfo
.
RoomNumber
&
nbsp
;&
nbsp
;&
nbsp
;
Dim
customFontSize
as
Single
=
roomInfo
.
CustomFontSize
&
nbsp
;&
nbsp
;&
nbsp
;
Dim
textSize
As
Single
&
nbsp
;&
nbsp
;&
nbsp
;
If
Not
String
.
IsNullOrEmpty
(
customFontSize
)
Then
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
textSize
=
Convert
.
ToSingle
(
customFontSize
)
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
Dim
textStyle
As
NTextStyle
=
CType
(
s
.
ComposeTextStyle
().
Clone
(),
NTextStyle
)
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
textStyle
.
FontStyle
=
New
NFontStyle
("
Arial
",
textSize
)
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
NStyle
.
SetTextStyle
(
s
,
textStyle
)
&
nbsp
;&
nbsp
;&
nbsp
;
End
If
&
nbsp
;
End
If
Next
Reply
Like
0
Nevron Support
Nevron Support
posted 3 Years Ago
ANSWER
Post Details
Group: Administrators
Posts: 3.1K,
Visits: 4.1K
Hi
Kirk
,
A
better
solution
would
be
to
create
a
custom
NShapeCreatedListener
and
then
override
its
OnPolygonLabelCreated
method
.
This
method
is
called
every
time
a
label
of
a
polygon
(
room
in
your
case
)
is
created
.
You
can
use
it
to
modify
the
style
of
the
created
map
label
.
Please
take
a
look
at
the
following
NOV
Diagram
web
example
:
http
://
examplesaspnetdiagram
.
nevron
.
com
/
Frames
/
NExampleFrame
.
aspx
?
ExampleUrl
=
Examples
%
2fMaps
%
2fNWorldPopulationUC
.
ascx
You
will
find
the
custom
implementation
of
the
NShapeCreatedListener
at
the
end
of
the
code
in
the
"
Source
Code
"
tab
.
We
hope
this
helps
.
Let
us
know
if
you
have
any
questions
.
Best Regards,
Nevron Support Team
Reply
Like
0
GO
Merge Selected
Merge into selected topic...
Merge into merge target...
Merge into a specific topic ID...
Open Merge
Post Reply
Similar Topics
Post Quoted Reply
Reading This Topic
2 active, 2 guests, 0 members, 0 anonymous
No members currently viewing this topic!
Login
Login
Remember Me
Reset Password
Resend Validation Email
Login
Explore
Messages
Mentions
Search