/*!
Callback function for adding text frame.
550936
function insertTextFrame( $params, $text )
    {
        $prevColor = $this->currentColour;
        $prevFontSize = $this->fontSize();
        $prevFont = $this->currentFont();

        if ( isset( $params['fontSize'] ) )
        {
            $this->setFontSize( $params['fontSize'] );
        }

        if ( isset( $params['fontName'] ) )
        {
            $this->selectFont( $params['fontName'] );
        }

        $cmykKeys = array( 'c', 'm', 'y', 'k' );
        if ( isset( $params ['frameCMYK'] ) )
        {
            $params['frameCMYK'] = explode( ',', $params['frameCMYK'] );
            foreach ( $cmykKeys as $oldKey => $newKey )
            {
                $params['frameCMYK'][$newKey] = $params['frameCMYK'][$oldKey];
                unset( $params['frameCMYK'][$oldKey] );
            }
        }
        if ( isset( $params['textCMYK'] ) )
        {
            $params['textCMYK'] = explode( ',', $params['textCMYK'] );
            foreach ( $cmykKeys as $oldKey => $newKey )
            {
                $params['textCMYK'][$newKey] = $params['textCMYK'][$oldKey];
                unset( $params['textCMYK'][$oldKey] );
            }
        }

        $padding = 0;
        if ( isset( $params['padding'] ) )
        {
            $padding = $params['padding'];
        }

        $leftPadding = $padding;
        $rightPadding = $padding;
        $topPadding = $padding;
        $bottomPadding = $padding;

        if ( isset( $params['leftPadding'] ) )
        {
            $leftPadding = $params['leftPadding'];
        }
        if ( isset( $params['rightPadding'] ) )
        {
            $rightPadding = $params['rightPadding'];
        }
        if ( isset( $params['topPadding'] ) )
        {
            $topPadding = $params['topPadding'];
        }
        if ( isset( $params['bottomPadding'] ) )
        {
            $bottomPadding = $params['bottomPadding'];
        }

        $yOffset = $this->yOffset();
        $xOffset = $this->xOffset();

        $fontHeight = $this->getFontHeight( $this->ez['fontSize'] );
        $fontDecender = $this->getFontDecender( $this->ez['fontSize'] );
        $textWidth = $this->getTextWidth( $this->ez['fontSize'], $text );

        $totalHeight = $fontHeight + $topPadding;
        $totalWidth = $textWidth + $leftPadding + $rightPadding;

        if ( $rightPadding == -1 )
        {
            $totalWidth = $leftPadding + $this->ez['pageWidth'] - $xOffset + 10;
        }

        if ( isset( $params['frameCMYK'] ) )
        {
            $this->setColor( $params['frameCMYK'] );
        }
        $this->filledRectangle( $xOffset - $leftPadding,
                                $yOffset - $bottomPadding,
                                $totalWidth,
                                $totalHeight );

        if ( isset( $params['roundEnds'] ) )
        {
            if ( $rightPadding != -1 )
            {
                $this->filledEllipse( $xOffset + $textWidth + $rightPadding, $yOffset - $bottomPadding + ( $totalHeight / 2 ), $totalHeight / 2 );
            }
            if ( $leftPadding != -1 )
            {
                $this->filledEllipse( $xOffset - $leftPadding, $yOffset - $bottomPadding + ( $totalHeight / 2 ), $totalHeight / 2 );
            }
        }

        if ( isset( $params['textCMYK'] ) )
        {
            $this->setColor( $params['textCMYK'] );
        }
        else
        {
            $this->setColor( $prevColor );
        }
        $this->addText( $xOffset, $yOffset, $this->fontSize(), $text );

        $this->setColor( $prevColor );
        $this->setFontSize( $prevFontSize );
        $this->selectFont( $prevFont );
    }
1050292
function callFrameLine( $info )
    {
        $parameters = array();
        eZPDFTable::extractParameters( $info['p'], 0, $parameters, true );

        $location = $parameters['location'];
        $yOffset = $parameters['margin'];
        if ( $location == 'frame_header' )
        {
            $yOffset = $this->ez['pageHeight'] - $parameters['margin'];
        }

        $rightMargin = $this->rightMargin( $yOffset );
        if ( isset( $parameters['rightMargin'] ) )
        {
            $rightMargin = $parameters['rightMargin'];
        }

        $leftMargin = $this->leftMargin( $yOffset );
        if ( isset( $parameters['leftMargin'] ) )
        {
            $leftMargin = $parameters['leftMargin'];
        }

        $this->setLineStyle( $parameters['thickness'] );

        reset( $this->ezPages );
        foreach ( $this->ezPages as $pageNum => $pageID )
        {
            if( $pageNum < $parameters['pageOffset'] )
                continue;

            if ( $parameters['page'] == 'odd' &&
                 $pageNum % 2 == 0 )
                continue;

            if ( $parameters['page'] == 'even' &&
                 $pageNum % 2 == 1 )
                continue;

            $this->reopenObject( $pageID );
            $this->line( $leftMargin, $yOffset, $this->ez['pageWidth'] - $rightMargin, $yOffset );
            $this->closeObject();
        }

        $this->setLineStyle( 1 );
    }
320556
def __add_text(self, text):
        """"""
        if text is not None and not isinstance(text, six.text_type):
            raise TypeError('Local symbol definition must be a Unicode sequence or None: %r' % text)
        sid = self.__new_sid()
        location = None
        if self.table_type.is_shared:
            location = self.__import_location(sid)
        token = SymbolToken(text, sid, location)
        self.__add(token)
        return token
165355
Frame updateFrame(Frame target, Frame src) {
    if (src != target) ltrash(src);
    return src;
  }
296163
function startTagInFrameset(p, token) {
    const tn = token.tagName;

    if (tn === $.HTML) {
        startTagInBody(p, token);
    } else if (tn === $.FRAMESET) {
        p._insertElement(token, NS.HTML);
    } else if (tn === $.FRAME) {
        p._appendElement(token, NS.HTML);
        token.ackSelfClosing = true;
    } else if (tn === $.NOFRAMES) {
        startTagInHead(p, token);
    }
}
1331211
public function addTextField(PHPRtfLite_Font $font = null, PHPRtfLite_ParFormat $parFormat = null)
    {
        $textField = new PHPRtfLite_FormField_Text($this->_rtf, $font, $parFormat);
        $this->_elements[] = $textField;
        return $textField;
    }
981307
def new_text_block(self, **kwargs):
        """"""
        proto = {'content': '', 'type': self.markdown}
        proto.update(**kwargs)
        return proto
399952
function structHandlerText( $element, $newParent )
    {
        $ret = array();
        $parent = $element->parentNode;

        // Remove empty text elements
        if ( $element->textContent == '' )
        {
            $element = $parent->removeChild( $element );
            return $ret;
        }

        $ret = $this->appendLineParagraph( $element, $newParent );

        // Fix for italic/bold styles in Mozilla.
        $addStrong = $addEmph = null;
        $myParent = $element->parentNode;
        while( $myParent )
        {
            $style = $myParent->getAttribute( 'style' );
            if ( $style && $addStrong !== false && strpos( $style, 'font-weight: bold;' ) !== false )
            {
                $addStrong = true;
            }
            if ( $style && $addEmph !== false && strpos( $style, 'font-style: italic;' ) !== false )
            {
                $addEmph = true;
            }

            if ( $myParent->nodeName === 'strong' )
            {
                $addStrong = false;
            }
            elseif ( $myParent->nodeName === 'emphasize' )
            {
                $addEmph = false;
            }
            elseif ( $myParent->nodeName === 'td'
                  || $myParent->nodeName === 'th'
                  || $myParent->nodeName === 'section' )
            {
                break;
            }
            $tmp = $myParent;
            $myParent = $tmp->parentNode;
        }

        $parent = $element->parentNode;
        if ( $addEmph === true )
        {
            $emph = $this->Document->createElement( 'emphasize' );
            $emph = $parent->insertBefore( $emph, $element );
            $element = $parent->removeChild( $element );
            $emph->appendChild( $element );
        }
        if ( $addStrong === true )
        {
            $strong = $this->Document->createElement( 'strong' );
            $strong = $parent->insertBefore( $strong, $element );
            $element = $parent->removeChild( $element );
            $strong->appendChild( $element );
        }

        // Left trim spaces:
        if ( $this->TrimSpaces )
        {
            $trim = false;
            $currentElement = $element;

            // Check if it is the first element in line
            do
            {
                if ( $currentElement->previousSibling )
                {
                    break;
                }

                $currentElement = $currentElement->parentNode;

                if ( $currentElement instanceof DOMElement &&
                     ( $currentElement->nodeName === 'line' ||
                       $currentElement->nodeName === 'paragraph' ) )
                {
                    $trim = true;
                    break;
                }

            } while ( $currentElement instanceof DOMElement );

            if ( $trim )
            {
                // Trim and remove if empty
                $parent = $element->parentNode;
                $trimmedElement = new DOMText( ltrim( $element->textContent ) );

                if ( $trimmedElement->textContent == '' )
                {
                    $parent->removeChild( $element );
                }
                else
                {
                    $parent->replaceChild( $trimmedElement, $element );
                }
            }
        }

        return $ret;
    }
1062931
public function addItem($text,
        PHPRtfLite_Font $font = null,
        PHPRtfLite_ParFormat $parFormat = null,
        $convertTagsToRtf = true
    ) {
        if ($font === null) {
            $font = $this->_font;
        }
        if ($parFormat === null) {
            $parFormat = $this->_parFormat;
        }

        $element = new PHPRtfLite_Element($this->_rtf, $text, $font, $parFormat);
        if ($convertTagsToRtf) {
            $element->setConvertTagsToRtf();
        }
        $this->_items[] = $element;

        return $this;
    }
235553
static function decorate_root(Frame $root, Dompdf $dompdf)
    {
        $frame = new PageFrameDecorator($root, $dompdf);
        $frame->set_reflower(new PageFrameReflower($frame));
        $root->set_decorator($frame);

        return $frame;
    }
656815
def addFreetextAnnot(self, rect, text, fontsize=12, fontname=None, color=None, rotate=0):
        """"""
        CheckParent(self)

        val = _fitz.Page_addFreetextAnnot(self, rect, text, fontsize, fontname, color, rotate)

        if not val: return
        val.thisown = True
        val.parent = weakref.proxy(self)
        self._annot_refs[id(val)] = val

        return val
305166
public function addFrame(Frame $frame)
    {
        $tmpFrame = clone $frame;
        $tmpFrame->resize($this->width, $this->height);
        ob_start();
        imagegif($tmpFrame->toGDImage());
        $this->frames[] = ob_get_clean();
        $tmpFrame = null;
    }
881904
function() {
			var parent = document.body;
			this.$frameParent = parent;
			this.$$modalExclusions = this.$$modalExclusions || [];
			var range = document.createRange();
			range.selectNode(parent);
			var frameFragment = range.createContextualFragment(this.CONTAINERTEMPLATE);
			parent.appendChild(frameFragment);
			this.$frame = parent.lastChild;
			this.$frame.tabIndex = -1;
			this.$frame.style.outline = "none";
//			this.handle = lib.addAutoDismiss([this.$frame], this.hide.bind(this));
			if (this.title) {
				lib.$(".dialogTitleText", this.$frame).appendChild(document.createTextNode(this.title)); //$NON-NLS-0$
				this.$frame.setAttribute("aria-label", this.title); //$NON-NLS-0$
			}
			this.$close = lib.$(".closeDialog", this.$frame);//$NON-NLS-0$
			this.$close.setAttribute("aria-label", containerMessages["Close"]); //$NON-NLS-0$
			var self = this;
			this.$close.addEventListener("click", function(event) { //$NON-NLS-0$
				self.hide();
			}, false);
						
			this.$parent = lib.$(".dialogContent", this.$frame); //$NON-NLS-0$
			range = document.createRange();
			range.selectNode(this.$parent);
			var contentFragment = range.createContextualFragment(this.TEMPLATE);
			if (this.messages) {
				lib.processTextNodes(contentFragment, this.messages);
			}
			this.$parent.appendChild(contentFragment);
			this.$buttonContainer = lib.$(".dialogButtons", this.$frame); //$NON-NLS-0$
			this._makeButtons();
			
			// hook key handlers.  This must be done after _makeButtons so that the default callback (if any)
			// is established.
			this.$frame.addEventListener("keydown", function (e) { //$NON-NLS-0$
				if(e.keyCode === lib.KEY.ESCAPE) {
					self.hide();
				} else if (e.keyCode === lib.KEY.ENTER && (typeof self._defaultCallback) === "function") { //$NON-NLS-0$
					self._defaultCallback();
				}
			}, false);
			
			this._bindElements(this.$parent);
			if (typeof this._bindToDom === "function") { //$NON-NLS-0$
				this._bindToDom(this.$parent);
			}
		}
686760
def extend_src_text(self, content, context, text_list, category):
        """"""

        prefix = self.prefix + '-' if self.prefix else ''

        for comment, line, encoding in text_list:
            content.append(
                filters.SourceText(
                    textwrap.dedent(comment),
                    "%s (%d)" % (context, line),
                    encoding,
                    prefix + category
                )
            )
1144819
def insert_text(self, string):
        """
        self.l_buffer.insert_text(string, self.argument_reset)
        self.finalize()
778837
function tokenizeText(text, callback) {
    "use strict";
    processTokens(tokenizer.tokenize(text) || [], function (error, tokens) {
        process.nextTick(function () {
            callback(error, tokens);
        });
    });
}
1231017
function(frame) {
    var strCss = '';
    if (frame.type === 'keyframe') {
      strCss += frame.values.join(',') + ' {';
      frame.declarations.forEach(function(declaration) {
        strCss += commentOrDeclaration(declaration);
      });
      strCss += '\n}\n\n';
    } else if (frame.type === 'comment') {
      strCss += processComment(frame) + '\n\n';
    }
    return strCss;
  }