Euphemia UCAS — Macintosh witness and Cree research specimen, 2011
From the originals
25 scansMachine-transcribed text and image descriptions. Check the linked original for uncertain words or fine print.
PDF page 11
PREPUBLICATION DRAFT (revised March 2011). To appear as: Jancewicz, Bill, & Junker, Marie-Odile. Cree syllabic fonts: development, compatibility and usage in the digital world. In Valentine, Randolph (ed.) Papers of the 40 th Algonquian Conference. 11 Collaborative IT Applications Within the East Cree speakers’ community and especially in the wake of the collaborative project eastcree.org 2 , several interesting IT collaborative applications have proven successful. They all allow educators and language specialists to collaboratively produce resources and material for supporting the transmission of the Cree language and culture, while working at a distance, in communities that are sometimes thousands of kilometres apart. They all involve web-based editing, and typing in Cree syllabics in browsers. They include: • Image and sound database for the encyclopaedic dictionary, developed in 2007, this allows for uploading of images and sounds to the on-line Cree dictionary. • Editing for book production: This application is the most recent (developed on eastcree.org in 2008 by Delasie Torkornoo): staff members at Cree programs are now using an on-line editing tool (Google docs style) for creating and producing their school books in Cree syllabics. 2 The eastcree.org project started in 2000 as an effort to develop language resources for the East Cree teachers and speakers exploring how IT could help language documentation and preservation. The nine East Cree communities in Northern Quebec have their own school board, the Cree School Board, whose Cree Programs department became a partner to the project in 2001. The maintenance of the site is progressively being transferred to the School Board, while the development of the resources continues to involve Cree language specialists and linguists.
- Printed dates
- March 2011 · 2007 · 2008 · 2000 · 2001
- Languages
- English · Cree
PDF page 12
PREPUBLICATION DRAFT (revised March 2011). To appear as: Jancewicz, Bill, & Junker, Marie-Odile. Cree syllabic fonts: development, compatibility and usage in the digital world. In Valentine, Randolph (ed.) Papers of the 40 th Algonquian Conference. 12 • Editing and maintenance of an on-line Educational Resources catalogue. This application was the first one, developed in 2002, and served as a successful model for later versions. It is widely used by educators in the Cree communities.
Reading notes: Headline ambiguous: no primary printed heading identified in the supplied copy
- Printed dates
- March 2011 · 2002
- Languages
- English
PDF page 13
PREPUBLICATION DRAFT (revised March 2011). To appear as: Jancewicz, Bill, & Junker, Marie-Odile. Cree syllabic fonts: development, compatibility and usage in the digital world. In Valentine, Randolph (ed.) Papers of the 40 th Algonquian Conference. 13 • Editing and maintenance of an Oral stories database with an Elders’ biographies database. Developed in 2003, this database now contains over 500 oral stories and is still being populated (see Junker and Luchian (2007), for a discussion). It is also widely used.
- Printed dates
- March 2011 · 2003 · 2007
- Languages
- English
PDF page 14
PREPUBLICATION DRAFT (revised March 2011). To appear as: Jancewicz, Bill, & Junker, Marie-Odile. Cree syllabic fonts: development, compatibility and usage in the digital world. In Valentine, Randolph (ed.) Papers of the 40 th Algonquian Conference. 14
- Printed dates
- March 2011
- Languages
- English
PDF page 15
PREPUBLICATION DRAFT (revised March 2011). To appear as: Jancewicz, Bill, & Junker, Marie-Odile. Cree syllabic fonts: development, compatibility and usage in the digital world. In Valentine, Randolph (ed.) Papers of the 40 th Algonquian Conference. 15 Conclusion Like standardisation of orthography, standardisation of technology is essential. Changes in the digital world have allowed the widespread use of Unicode, but the question of what are the best tools and whether they can be understood and accessed by the people who need them, remains. As minority languages, Cree and other aboriginal languages remain vulnerable to the dominance of English in the domain of software development, hardware preferences for certain platforms, and ever-changing technologies. As is the case for the development of practical orthographies, the appropriate and successful development of language-specific information technology tends to occur at the grassroots level, and is informed by specialized (often non- commercial and non-mainstream) knowledge. Standardization of technology can only be achieved if there is cooperation between all the stakeholders and a routine dialogue and collaboration between developers and users. It is our hope that this paper will at least in part continue this dialogue.
- Printed dates
- March 2011
- Languages
- English · Cree
PDF page 16
Cree syllabic fonts: development, compatibility and usage in the digital world
PREPUBLICATION DRAFT (revised March 2011). To appear as: Jancewicz, Bill, & Junker, Marie-Odile. Cree syllabic fonts: development, compatibility and usage in the digital world. In Valentine, Randolph (ed.) Papers of the 40 th Algonquian Conference. 16 We recommend that anyone who endeavours to research, to work with or to use an Aboriginal language should explore collaboration and the sharing of resources as a key to success, not just to themselves, but also to the viability of the language as a whole. Web Resources East Cree fonts and keyboard packages: http://www.eastcree.org/cree/en/resources/cree-fonts/ Eastern James Bay Cree talking syllabic chart: http://www.eastcree.org/keyboard.html Training videos in Cree, French, English: http://www.eastcree.org/cree/en/resources/videos/ Tiro Typeworks: http://www.tiro.com/syllabics/resources/syllabic_resources.html. Cree Unicode fonts: http://www.eastcree.org/cree/en/resources/cree-fonts/ http://www.languagegeek.com/font/fontdownload.html#Full_Unicode http://www.evertype.com/emono/ http://www.fonts2u.com/category.html?id=97 http://dejavu-fonts.org/ The Dojo Toolkit: http://www.sitepen.com/blog/2008/09/08/custom-fonts-with-dojoxgfx The Unicode Consortium: http://unicode.org/ Tavultesoft Keyman Desktop: http://www.tavultesoft.com/ SIL International: http://scripts.sil.org/home Currently Available Typefaces (Unicode Cree Syllabic Fonts) BJCree UNI The BJCree UNI font contains glyphs for East and West Cree and Naskapi, in both Bold and Regular weights. As with any other fonts used in computing, texts produced using one Cree Unicode font may be re-formatted using glyphs in other styles, found in other syllabic font designs. The BJCree UNI font has been designed in consultation with readers of syllabics for clarity, smooth reading with a robust accompanying bold weight face. BJCree UNI comes with the Windows and Macintosh packages described in this paper. (http://eastcree.org/en/resources.html). An alternate version of BJCree UNI has been developed to address differing preferences for the
Reading notes: Source text ends mid-sentence at 'preferences for the'. Some URLs are reproduced as printed and may be truncated or inconsistent.
- Printed product names
- BJCree UNI · Tiro Typeworks · Tavultesoft Keyman Desktop · SIL International · The Dojo Toolkit · The Unicode Consortium
- Printed dates
- 2011 · 2008 · 40 th
- Languages
- English · Cree · French · Naskapi
PDF page 17
PREPUBLICATION DRAFT (revised March 2011). To appear as: Jancewicz, Bill, & Junker, Marie-Odile. Cree syllabic fonts: development, compatibility and usage in the digital world. In Valentine, Randolph (ed.) Papers of the 40 th Algonquian Conference. 17 “sh” series character. BJCree2 UNI is identical in every other way to BJCree UNI except in the orientation of this series of characters. Users will recognise BJCree2 UNI as more closely matching the style of the traditional Cree religious literature, especially the Walton and Horden Bibles and Prayer Books. LanguageGeek One of the most important sources for Cree Unicode fonts is the LanguageGeek website by Chris Harvey. Chris Harvey developed “Aboriginal Serif Unicode”, which has gone through some changes and improvements. His current strategy is to serve logical regions of syllabic users with fonts that contain subsets of the UCAS block, rather than one font that contains them all. His work is very impressive and professional but some readers may find it difficult to read because of somewhat close letter- and especially word-spacing. (http://www.languagegeek.com/font/fontdownload.html - Full_Unicode) He has also begun to develop some creative font designs that every user of Unicode syllabics should have installed in their fonts folder for variety:
Reading notes: Source is a prepublication draft; the heading and author line are not an explicit primary headline Text ends mid-sentence, suggesting truncated extraction
- Printed dates
- March 2011
- Languages
- English
PDF page 18
PREPUBLICATION DRAFT (revised March 2011). To appear as: Jancewicz, Bill, & Junker, Marie-Odile. Cree syllabic fonts: development, compatibility and usage in the digital world. In Valentine, Randolph (ed.) Papers of the 40 th Algonquian Conference. 18 Other Unicode Cree Syllabic Fonts Ron Ogawa's “Ballymun RO” Unicode font is an interesting variation that uses an unorthodox treatment of the glyph stems (varying stroke width, as with a quill pen. Note: no longer available at this Multedata website: (http://www.multedata.ca/p20.htm). However, all versions can still be downloaded at Fonts2u.com (Canadian Syllabics). Another font that contains a huge number of glyphs is “Code2000”, used to test browser compatibility with Unicode. But the glyph shapes (for Canadian Syllabics, anyway) tend to be boxy, and not well-formed for legibility. It is a shareware font designed by James Kass: he asks for a $5.00 fee for those who choose to use this font. (www.code2000.net) Still, we recommend this site for many resources for people who are working with Unicode fonts on the web. It has many tools for testing font display, and web technicians will find that it is worth checking out.
Reading notes: Source text names the Ballymun RO font without a clear product heading Reading order of the in-text parenthetical about the Multedata website is unclear
- Printed product names
- Ballymun RO · Code2000
- Printed prices
- $5.00
- Printed dates
- March 2011
- Languages
- English
PDF page 19
PREPUBLICATION DRAFT (revised March 2011). To appear as: Jancewicz, Bill, & Junker, Marie-Odile. Cree syllabic fonts: development, compatibility and usage in the digital world. In Valentine, Randolph (ed.) Papers of the 40 th Algonquian Conference. 19 The Canadian Bible Society’s Jeff Klassen has produced CBSUCAS, (also available as an OpenType font) another full set. It is better looking than some but the version that I have has some proportional and spacing issues with the “dots”. In a recent (April 2008) communication with Jeff Klassen, he notes that he has been unable to work on improvements to the font since 2006, and apologizes that the link to the source may be broken, but still plans to fix this when he gets the chance. (http://confluence.ubs-icap.org/display/~jklassen/Home) The DejaVu fonts project was started by Št ě pán Roh. Over time, it has absorbed several other projects that also existed to extend the Bitstream Vera typefaces. The DejaVu syllabic fonts are modifications of the Bitstream Vera fonts designed to extend this original for greater coverage of Unicode. This is a collaborative Open Source project. As of this writing (Feb 2009) some of the fonts (DejaVu Sans, DejaVu Sans Condensed) now include coverage for Canadian Syllabics. The fonts are free as in ‘freedom’, and may thus freely be embedded. DejaVu fonts can be obtained from the DejaVu project on SourceForge. (http://dejavu-fonts.org/) Michael Everson created Everson Mono (former name: Everson Mono Unicode). He says on his website: “Everson Mono is a simple, elegant, monowidth font.” (http://www.evertype.com/emono/)
Reading notes: Reading order of the reference line before the body text is uncertain Name 'Št ě pán Roh' contains spacing that may reflect extraction rather than print
- Printed product names
- CBSUCAS · OpenType · DejaVu Sans · DejaVu Sans Condensed · Everson Mono · Everson Mono Unicode · Bitstream Vera
- Printed dates
- March 2011 · April 2008 · 2006 · Feb 2009
- Languages
- English
PDF page 20
PREPUBLICATION DRAFT (revised March 2011). To appear as: Jancewicz, Bill, & Junker, Marie-Odile. Cree syllabic fonts: development, compatibility and usage in the digital world. In Valentine, Randolph (ed.) Papers of the 40 th Algonquian Conference. 20 The Tiro Typeworks website notes that they have developed a new Unicode syllabic font Canadian Syllabics & Latin Scripts named “Euphemia”: We are very pleased that a professional type foundry has been involved in the design of a Canadian syllabic script. This is another fine font that should be on every syllabics users system: “...Euphemia covers most languages which use the Canadian Syllabic script including various Cree orthographies, Inuktitut and the historical Carrier script. Three fonts are available with free end-user licenses in TrueType-OpenType format.” (Quoted Feb 2009, for Euphemia version 2.66. http://www.tiro.com/syllabics/resources/syllabic_resources.html) Euphemia now comes as part of the Macintosh Operating system since Mac OS X.4, and it is also part of the Windows Vista operating system. This font is also freely downloadable from the Tiro Typeworks website (for end-users only, see the License Agreement on their site) (http://www.tiro.com/)
Reading notes: Source is a prepublication draft header with a bibliographic citation; no primary headline is clearly printed. Version number '2.66' is a version identifier rather than a date and may be misclassified in printedDates.
- Printed product names
- Euphemia · Canadian Syllabics & Latin Scripts · Mac OS X.4 · Windows Vista
- Printed dates
- March 2011 · Feb 2009 · 2.66
- Languages
- English
PDF page 21
PREPUBLICATION DRAFT (revised March 2011). To appear as: Jancewicz, Bill, & Junker, Marie-Odile. Cree syllabic fonts: development, compatibility and usage in the digital world. In Valentine, Randolph (ed.) Papers of the 40 th Algonquian Conference. 21 Eastern James Bay Cree Syllabic Chart References Jancewicz, Bill and Marie-Odile Junker. 2002. Cree on the Internet: How to Integrate Syllabics with Information Technology and the Web. Presented at the 34th Algonquian Conference , Queens University. http://www.eastcree.org/pdf/FAQ.pdf Junker, Marie-Odile and Radu Luchian. 2007. Developing web databases for Aboriginal language preservation. Literary and Linguistic Computing 22(2), June 2007:187- 206. Junker, Marie-Odile and Terry Stewart. 2008. Building Search Engines for Algonquian Languages. In Karl S. Hele and Regna Darnell (eds). Papers of the 39th Algonquian Conference. London: University of Western Ontario Press: 378-411.
Reading notes: Source text is a bibliographic citation list and draft header rather than advertising copy, so no headline, products or prices are present.
- Printed dates
- March 2011 · 2002 · 2007 · 2008
- Languages
- English
Document section 1
/** * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. * (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #include "config.h" #include "RenderTextControl.h" #include "AXObjectCache.h" #include "CharacterNames.h" #include "Editor.h" #include "Event.h" #include "EventNames.h" #include "Frame.h" #include "HTMLBRElement.h" #include "HTMLNames.h" #include "HitTestResult.h" #include "RenderLayer.h" #include "RenderText.h" #include "ScrollbarTheme.h" #include "SelectionController.h" #include "Text.h" #include "TextControlInnerElements.h" #include "TextIterator.h" using namespace std; namespace WebCore { using namespace HTMLNames; // Value chosen by observation. This can be tweaked. static const int minColorContrastValue = 1300; static Color disabledTextColor(const Color& textColor, const Color& backgroundColor) { // The explicit check for black is an optimization for the 99% case (black on white). // This also means that black on black will turn into grey on black when disabled. Color disabledColor; if (textColor.rgb() == Color::black || differenceSquared(textColor, Color::white) > differenceSquared(backgroundColor, Color::white)) disabledColor = textColor.light(); else disabledColor = textColor.dark(); // If there's not very much contrast between the disabled color and the background color, // just leave the text color alone. We don't want to change a good contrast color scheme so that it has really bad contrast. // If the the contrast was already poor, then it doesn't do any good to change it to a different poor contrast color scheme. if (differenceSquared(disabledColor, backgroundColor) detach(); } void RenderTextControl::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle) { RenderBlock::styleDidChange(diff, oldStyle); if (m_innerText) { RenderBlock* textBlockRenderer = toRenderBlock(m_innerText->renderer()); RefPtr textBlockStyle = createInnerTextStyle(style()); // We may have set the width and the height in the old style in layout(). // Reset them now to avoid getting a spurious layout hint. textBlockRenderer->style()->setHeight(Length()); textBlockRenderer->style()->setWidth(Length()); setInnerTextStyle(textBlockStyle); } setReplaced(isInline()); } void RenderTextControl::setInnerTextStyle(PassRefPtr style) { if (m_innerText) { RefPtr textStyle = style; m_innerText->renderer()->setStyle(textStyle); for (Node* n = m_innerText->firstChild(); n; n = n->traverseNextNode(m_innerText.get())) { if (n->renderer()) n->renderer()->setStyle(textStyle); } } } static inline bool updateUserModifyProperty(Node* node, RenderStyle* style) { bool isEnabled = true; bool isReadOnlyControl = false; if (node->isElementNode()) { Element* element = static_cast(node); isEnabled = element->isEnabledFormControl(); isReadOnlyControl = element->isReadOnlyFormControl(); } style->setUserModify((isReadOnlyControl || !isEnabled) ? READ_ONLY : READ_WRITE_PLAINTEXT_ONLY); return !isEnabled; } void RenderTextControl::adjustInnerTextStyle(const RenderStyle* startStyle, RenderStyle* textBlockStyle) const { // The inner block, if present, always has its direction set to LTR, // so we need to inherit the direction from the element. textBlockStyle->setDirection(style()->direction()); bool disabled = updateUserModifyProperty(node(), textBlockStyle); if (disabled) textBlockStyle->setColor(disabledTextColor(textBlockStyle->color(), startStyle->backgroundColor())); } void RenderTextControl::createSubtreeIfNeeded(TextControlInnerElement* innerBlock) { if (!m_innerText) { // Create the text block element // For non-search fields, there is no intermediate innerBlock as the shadow node. // m_innerText will be the shadow node in that case. RenderStyle* parentStyle = innerBlock ? innerBlock->renderer()->style() : style(); m_innerText = new TextControlInnerTextElement(document(), innerBlock ? 0 : node()); m_innerText->attachInnerElement(innerBlock ? innerBlock : node(), createInnerTextStyle(parentStyle), renderArena()); } } int RenderTextControl::textBlockHeight() const { return height() - paddingTop() - paddingBottom() - borderTop() - borderBottom(); } int RenderTextControl::textBlockWidth() const { return width() - paddingLeft() - paddingRight() - borderLeft() - borderRight() - m_innerText->renderBox()->paddingLeft() - m_innerText->renderBox()->paddingRight(); } void RenderTextControl::updateFromElement() { updateUserModifyProperty(node(), m_innerText->renderer()->style()); } void RenderTextControl::setInnerTextValue(const String& innerTextValue) { String value; if (innerTextValue.isNull()) value = ""; else { value = innerTextValue; value = document()->displayStringModifiedByEncoding(value); } if (value != text() || !m_innerText->hasChildNodes()) { if (value != text()) { if (Frame* frame = document()->frame()) { frame->editor()->clearUndoRedoOperations(); if (AXObjectCache::accessibilityEnabled()) document()->axObjectCache()->postNotification(this, AXObjectCache::AXValueChanged, false); } } ExceptionCode ec = 0; m_innerText->setInnerText(value, ec); ASSERT(!ec); if (value.endsWith("\n") || value.endsWith("\r")) { m_innerText->appendChild(new HTMLBRElement(brTag, document()), ec); ASSERT(!ec); } // We set m_lastChangeWasUserEdit to false since this change was not explicitly made by the user (say, via typing on the keyboard), see . m_lastChangeWasUserEdit = false; } static_cast(node())->setFormControlValueMatchesRenderer(true); } void RenderTextControl::setLastChangeWasUserEdit(bool lastChangeWasUserEdit) { m_lastChangeWasUserEdit = lastChangeWasUserEdit; document()->setIgnoreAutofocus(lastChangeWasUserEdit); } int RenderTextControl::selectionStart() { Frame* frame = document()->frame(); if (!frame) return 0; return indexForVisiblePosition(frame->selection()->start()); } int RenderTextControl::selectionEnd() { Frame* frame = document()->frame(); if (!frame) return 0; return indexForVisiblePosition(frame->selection()->end()); } void RenderTextControl::setSelectionStart(int start) { setSelectionRange(start, max(start, selectionEnd())); } void RenderTextControl::setSelectionEnd(int end) { setSelectionRange(min(end, selectionStart()), end); } void RenderTextControl::select() { setSelectionRange(0, text().length()); } void RenderTextControl::setSelectionRange(int start, int end) { end = max(end, 0); start = min(max(start, 0), end); ASSERT(!document()->childNeedsAndNotInStyleRecalc()); if (style()->visibility() == HIDDEN || !m_innerText || !m_innerText->renderer() || !m_innerText->renderBox()->height()) { cacheSelection(start, end); return; } VisiblePosition startPosition = visiblePositionForIndex(start); VisiblePosition endPosition; if (start == end) endPosition = startPosition; else endPosition = visiblePositionForIndex(end); // startPosition and endPosition can be null position for example when // "-webkit-user-select: none" style attribute is specified. if (startPosition.isNotNull() && endPosition.isNotNull()) { ASSERT(startPosition.deepEquivalent().node()->shadowAncestorNode() == node() && endPosition.deepEquivalent().node()->shadowAncestorNode() == node()); } VisibleSelection newSelection = VisibleSelection(startPosition, endPosition); if (Frame* frame = document()->frame()) frame->selection()->setSelection(newSelection); // FIXME: Granularity is stored separately on the frame, but also in the selection controller. // The granularity in the selection controller should be used, and then this line of code would not be needed. if (Frame* frame = document()->frame()) frame->setSelectionGranularity(CharacterGranularity); } VisibleSelection RenderTextControl::selection(int start, int end) const { return VisibleSelection(VisiblePosition(m_innerText.get(), start, VP_DEFAULT_AFFINITY), VisiblePosition(m_innerText.get(), end, VP_DEFAULT_AFFINITY)); } VisiblePosition RenderTextControl::visiblePositionForIndex(int index) { if (index range = Range::create(document()); range->selectNodeContents(m_innerText.get(), ec); ASSERT(!ec); CharacterIterator it(range.get()); it.advance(index - 1); Node* endContainer = it.range()->endContainer(ec); ASSERT(!ec); int endOffset = it.range()->endOffset(ec); ASSERT(!ec); return VisiblePosition(endContainer, endOffset, UPSTREAM); } int RenderTextControl::indexForVisiblePosition(const VisiblePosition& pos) { Position indexPosition = pos.deepEquivalent(); if (!indexPosition.node() || indexPosition.node()->rootEditableElement() != m_innerText) return 0; ExceptionCode ec = 0; RefPtr range = Range::create(document()); range->setStart(m_innerText.get(), 0, ec); ASSERT(!ec); range->setEnd(indexPosition.node(), indexPosition.deprecatedEditingOffset(), ec); ASSERT(!ec); return TextIterator::rangeLength(range.get()); } void RenderTextControl::subtreeHasChanged() { m_wasChangedSinceLastChangeEvent = true; m_lastChangeWasUserEdit = true; } String RenderTextControl::finishText(Vector& result) const { // Remove one trailing newline; there's always one that's collapsed out by rendering. size_t size = result.size(); if (size && result[size - 1] == '\n') result.shrink(--size); // Convert backslash to currency symbol. document()->displayBufferModifiedByEncoding(result.data(), result.size()); return String::adopt(result); } String RenderTextControl::text() { if (!m_innerText) return ""; Vector result; for (Node* n = m_innerText.get(); n; n = n->traverseNextNode(m_innerText.get())) { if (n->hasTagName(brTag)) result.append(&newlineCharacter, 1); else if (n->isTextNode()) { String data = static_cast(n)->data(); result.append(data.characters(), data.length()); } } return finishText(result); } static void getNextSoftBreak(RootInlineBox*& line, Node*& breakNode, unsigned& breakOffset) { RootInlineBox* next; for (; line; line = next) { next = line->nextRootBox(); if (next && !line->endsWithBreak()) { ASSERT(line->lineBreakObj()); breakNode = line->lineBreakObj()->node(); breakOffset = line->lineBreakPos(); line = next; return; } } breakNode = 0; breakOffset = 0; } String RenderTextControl::textWithHardLineBreaks() { if (!m_innerText) return ""; Node* firstChild = m_innerText->firstChild(); if (!firstChild) return ""; document()->updateLayout(); RenderObject* renderer = firstChild->renderer(); if (!renderer) return ""; InlineBox* box = renderer->isText() ? toRenderText(renderer)->firstTextBox() : toRenderBox(renderer)->inlineBoxWrapper(); if (!box) return ""; Node* breakNode; unsigned breakOffset; RootInlineBox* line = box->root(); getNextSoftBreak(line, breakNode, breakOffset); Vector result; for (Node* n = firstChild; n; n = n->traverseNextNode(m_innerText.get())) { if (n->hasTagName(brTag)) result.append(&newlineCharacter, 1); else if (n->isTextNode()) { Text* text = static_cast(n); String data = text->data(); unsigned length = data.length(); unsigned position = 0; while (breakNode == n && breakOffset position) { result.append(data.characters() + position, breakOffset - position); position = breakOffset; result.append(&newlineCharacter, 1); } getNextSoftBreak(line, breakNode, breakOffset); } result.append(data.characters() + position, length - position); } while (breakNode == n) getNextSoftBreak(line, breakNode, breakOffset); } return finishText(result); } int RenderTextControl::scrollbarThickness() const { // FIXME: We should get the size of the scrollbar from the RenderTheme instead. return ScrollbarTheme::nativeTheme()->scrollbarThickness(); } void RenderTextControl::calcHeight() { setHeight(m_innerText->renderBox()->borderTop() + m_innerText->renderBox()->borderBottom() + m_innerText->renderBox()->paddingTop() + m_innerText->renderBox()->paddingBottom() + m_innerText->renderBox()->marginTop() + m_innerText->renderBox()->marginBottom()); adjustControlHeightBasedOnLineHeight(m_innerText->renderer()->lineHeight(true, true)); setHeight(height() + paddingTop() + paddingBottom() + borderTop() + borderBottom()); // We are able to have a horizontal scrollbar if the overflow style is scroll, or if its auto and there's no word wrap. if (style()->overflowX() == OSCROLL || (style()->overflowX() == OAUTO && m_innerText->renderer()->style()->wordWrap() == NormalWordWrap)) setHeight(height() + scrollbarThickness()); RenderBlock::calcHeight(); } void RenderTextControl::hitInnerTextElement(HitTestResult& result, int xPos, int yPos, int tx, int ty) { result.setInnerNode(m_innerText.get()); result.setInnerNonSharedNode(m_innerText.get()); result.setLocalPoint(IntPoint(xPos - tx - x() - m_innerText->renderBox()->x(), yPos - ty - y() - m_innerText->renderBox()->y())); } void RenderTextControl::forwardEvent(Event* event) { if (event->type() == eventNames().blurEvent || event->type() == eventNames().focusEvent) return; m_innerText->defaultEventHandler(event); } IntRect RenderTextControl::controlClipRect(int tx, int ty) const { IntRect clipRect = contentBoxRect(); clipRect.move(tx, ty); return clipRect; } static const char* fontFamiliesWithInvalidCharWidth[] = { "American Typewriter", "Arial Hebrew", "Chalkboard", "Cochin", "Corsiva Hebrew", "Courier", "Euphemia UCAS", "Geneva", "Gill Sans", "Hei", "Helvetica", "Hoefler Text", "InaiMathi", "Kai", "Lucida Grande", "Marker Felt", "Monaco", "Mshtakan", "New Peninim MT", "Osaka", "Raanana", "STHeiti", "Symbol", "Times", "Apple Braille", "Apple LiGothic", "Apple LiSung", "Apple Symbols", "AppleGothic", "AppleMyungjo", "#GungSeo", "#HeadLineA", "#PCMyungjo", "#PilGi", }; // For font families where any of the fonts don't have a valid entry in the OS/2 table // for avgCharWidth, fallback to the legacy webkit behavior of getting the avgCharWidth // from the width of a '0'. This only seems to apply to a fixed number of Mac fonts, // but, in order to get similar rendering across platforms, we do this check for // all platforms. bool RenderTextControl::hasValidAvgCharWidth(AtomicString family) { static HashSet* fontFamiliesWithInvalidCharWidthMap = 0; if (!fontFamiliesWithInvalidCharWidthMap) { fontFamiliesWithInvalidCharWidthMap = new HashSet; for (unsigned i = 0; i add(AtomicString(fontFamiliesWithInvalidCharWidth[i])); } return !fontFamiliesWithInvalidCharWidthMap->contains(family); } float RenderTextControl::getAvgCharWidth(AtomicString family) { if (hasValidAvgCharWidth(family)) return roundf(style()->font().primaryFont()->avgCharWidth()); const UChar ch = '0'; return style()->font().floatWidth(TextRun(&ch, 1, false, 0, 0, false, false, false)); } float RenderTextControl::scaleEmToUnits(int x) const { // This matches the unitsPerEm value for MS Shell Dlg and Courier New from the "head" font table. float unitsPerEm = 2048.0f; return roundf(style()->font().size() * x / unitsPerEm); } void RenderTextControl::calcPrefWidths() { ASSERT(prefWidthsDirty()); m_minPrefWidth = 0; m_maxPrefWidth = 0; if (style()->width().isFixed() && style()->width().value() > 0) m_minPrefWidth = m_maxPrefWidth = calcContentBoxWidth(style()->width().value()); else { // Use average character width. Matches IE. AtomicString family = style()->font().family().family(); m_maxPrefWidth = preferredContentWidth(getAvgCharWidth(family)) + m_innerText->renderBox()->paddingLeft() + m_innerText->renderBox()->paddingRight(); } if (style()->minWidth().isFixed() && style()->minWidth().value() > 0) { m_maxPrefWidth = max(m_maxPrefWidth, calcContentBoxWidth(style()->minWidth().value())); m_minPrefWidth = max(m_minPrefWidth, calcContentBoxWidth(style()->minWidth().value())); } else if (style()->width().isPercent() || (style()->width().isAuto() && style()->height().isPercent())) m_minPrefWidth = 0; else m_minPrefWidth = m_maxPrefWidth; if (style()->maxWidth().isFixed() && style()->maxWidth().value() != undefinedLength) { m_maxPrefWidth = min(m_maxPrefWidth, calcContentBoxWidth(style()->maxWidth().value())); m_minPrefWidth = min(m_minPrefWidth, calcContentBoxWidth(style()->maxWidth().value())); } int toAdd = paddingLeft() + paddingRight() + borderLeft() + borderRight(); m_minPrefWidth += toAdd; m_maxPrefWidth += toAdd; setPrefWidthsDirty(false); } void RenderTextControl::selectionChanged(bool userTriggered) { cacheSelection(selectionStart(), selectionEnd()); if (Frame* frame = document()->frame()) { if (frame->selection()->isRange() && userTriggered) node()->dispatchEvent(Event::create(eventNames().selectEvent, true, false)); } } void RenderTextControl::addFocusRingRects(Vector& rects, int tx, int ty) { if (width() && height()) rects.append(IntRect(tx, ty, width(), height())); } HTMLElement* RenderTextControl::innerTextElement() const { return m_innerText.get(); } void RenderTextControl::updatePlaceholderVisibility(bool placeholderShouldBeVisible, bool placeholderValueChanged) { bool oldPlaceholderVisible = m_placeholderVisible; m_placeholderVisible = placeholderShouldBeVisible; if (oldPlaceholderVisible != m_placeholderVisible || placeholderValueChanged) { // Sets the inner text style to the normal style or :placeholder style. setInnerTextStyle(createInnerTextStyle(textBaseStyle())); // updateFromElement() of the subclasses updates the text content // to the element's value(), placeholder(), or the empty string. updateFromElement(); } } } // namespace WebCore
Reading notes: The supplied source text is a WebKit/WebCore C++ source file (RenderTextControl), not an advertisement, poster, or page, so no headline, product names, or prices appear in it. The years 2006, 2007 and 2008 appear only in the copyright notice of the license header comment, not as advertised dates. No visual layout or reading order can be verified because no image was supplied.
- Printed dates
- 2006 · 2007 · 2008
- Languages
- English