mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
accent marks on signs
This commit is contained in:
parent
9aeeb1ce1a
commit
b234ee8e29
@ -377,9 +377,18 @@ def DNASetBaselineString(baseline, text):
|
|||||||
# This should allow inlined graphics to stay in place.
|
# This should allow inlined graphics to stay in place.
|
||||||
# end of todo.
|
# end of todo.
|
||||||
DNARemoveAllChildrenOfClass(baseline, DNA_SIGN_TEXT);
|
DNARemoveAllChildrenOfClass(baseline, DNA_SIGN_TEXT);
|
||||||
for i in text:
|
|
||||||
|
# We can't just blindly iterate through the text, because it might
|
||||||
|
# be utf-8 encoded, meaning some characters are represented using
|
||||||
|
# multi-byte sequences. Instead, create a TextNode and use it to
|
||||||
|
# iterate through the characters of the text.
|
||||||
|
t = TextNode('')
|
||||||
|
t.setText(text)
|
||||||
|
for i in range(t.getNumChars()):
|
||||||
|
ch = t.getEncodedChar(i)
|
||||||
|
print "adding ch: %s" % (ch)
|
||||||
text=DNASignText("text")
|
text=DNASignText("text")
|
||||||
text.setLetters(i)
|
text.setLetters(ch)
|
||||||
baseline.add(text)
|
baseline.add(text)
|
||||||
|
|
||||||
|
|
||||||
@ -5381,7 +5390,8 @@ class LevelEditorPanel(Pmw.MegaToplevel):
|
|||||||
target=DNAGetChild(self.currentSignDNA, DNA_SIGN_BASELINE, index-1)
|
target=DNAGetChild(self.currentSignDNA, DNA_SIGN_BASELINE, index-1)
|
||||||
if target:
|
if target:
|
||||||
# Update panel info:
|
# Update panel info:
|
||||||
self.baselineString.set(DNAGetBaselineString(target))
|
s = DNAGetBaselineString(target)
|
||||||
|
self.baselineString.set(s)
|
||||||
self.fontMenu.selectitem(target.getCode())
|
self.fontMenu.selectitem(target.getCode())
|
||||||
try:
|
try:
|
||||||
val = 1.0/target.getWidth()
|
val = 1.0/target.getWidth()
|
||||||
@ -5436,7 +5446,7 @@ class LevelEditorPanel(Pmw.MegaToplevel):
|
|||||||
#print self, a, b, mode, self.baselineString.get()
|
#print self, a, b, mode, self.baselineString.get()
|
||||||
baseline=self.currentBaselineDNA
|
baseline=self.currentBaselineDNA
|
||||||
if baseline:
|
if baseline:
|
||||||
s=self.baselineString.get()
|
s = self.baselineString.get()
|
||||||
self.setBaselineString(s)
|
self.setBaselineString(s)
|
||||||
|
|
||||||
def addSignGraphic(self, code):
|
def addSignGraphic(self, code):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user