<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[286117] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/286117">286117</a></dd>
<dt>Author</dt> <dd>jya@apple.com</dd>
<dt>Date</dt> <dd>2021-11-22 12:35:05 -0800 (Mon, 22 Nov 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>Remove unused getEOTHeader method in OpenTypeUtilities.cpp
https://bugs.webkit.org/show_bug.cgi?id=233411
rdar://85656827

Reviewed by Youenn Fablet.

No change in behaviour.

* platform/graphics/opentype/OpenTypeUtilities.cpp:
* platform/graphics/opentype/OpenTypeUtilities.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsopentypeOpenTypeUtilitiescpp">trunk/Source/WebCore/platform/graphics/opentype/OpenTypeUtilities.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsopentypeOpenTypeUtilitiesh">trunk/Source/WebCore/platform/graphics/opentype/OpenTypeUtilities.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (286116 => 286117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2021-11-22 20:34:19 UTC (rev 286116)
+++ trunk/Source/WebCore/ChangeLog      2021-11-22 20:35:05 UTC (rev 286117)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2021-11-22  Jean-Yves Avenard  <jya@apple.com>
+
+        Remove unused getEOTHeader method in OpenTypeUtilities.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=233411
+        rdar://85656827
+
+        Reviewed by Youenn Fablet.
+
+        No change in behaviour.
+
+        * platform/graphics/opentype/OpenTypeUtilities.cpp:
+        * platform/graphics/opentype/OpenTypeUtilities.h:
+
</ins><span class="cx"> 2021-11-22  Chris Fleizach  <cfleizach@apple.com>
</span><span class="cx"> 
</span><span class="cx">         AX: WebKit: need a method to get visible text and frame of an element on screen
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsopentypeOpenTypeUtilitiescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/opentype/OpenTypeUtilities.cpp (286116 => 286117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/opentype/OpenTypeUtilities.cpp    2021-11-22 20:34:19 UTC (rev 286116)
+++ trunk/Source/WebCore/platform/graphics/opentype/OpenTypeUtilities.cpp       2021-11-22 20:35:05 UTC (rev 286117)
</span><span class="lines">@@ -197,155 +197,6 @@
</span><span class="cx">     m_buffer.append(reinterpret_cast<uint8_t*>(&padding), sizeof(padding));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool getEOTHeader(SharedBuffer* fontData, EOTHeader& eotHeader, size_t& overlayDst, size_t& overlaySrc, size_t& overlayLength)
-{
-    overlayDst = 0;
-    overlaySrc = 0;
-    overlayLength = 0;
-
-    size_t dataLength = fontData->size();
-    auto* data = fontData->data();
-
-    EOTPrefix* prefix = eotHeader.prefix();
-
-    prefix->fontDataSize = dataLength;
-    prefix->version = 0x00020001;
-    prefix->flags = 0;
-
-    if (dataLength < offsetof(sfntHeader, tables))
-        return false;
-
-    const sfntHeader* sfnt = reinterpret_cast<const sfntHeader*>(data);
-
-    if (dataLength < offsetof(sfntHeader, tables) + sfnt->numTables * sizeof(TableDirectoryEntry))
-        return false;
-
-    bool haveOS2 = false;
-    bool haveHead = false;
-    bool haveName = false;
-
-    const BigEndianUShort* familyName = 0;
-    unsigned short familyNameLength = 0;
-    const BigEndianUShort* subfamilyName = 0;
-    unsigned short subfamilyNameLength = 0;
-    const BigEndianUShort* fullName = 0;
-    unsigned short fullNameLength = 0;
-    const BigEndianUShort* versionString = 0;
-    unsigned short versionStringLength = 0;
-
-    for (unsigned i = 0; i < sfnt->numTables; i++) {
-        unsigned tableOffset = sfnt->tables[i].offset;
-        unsigned tableLength = sfnt->tables[i].length;
-
-        if (dataLength < tableOffset || dataLength < tableLength || dataLength < tableOffset + tableLength)
-            return false;
-
-        unsigned tableTag = sfnt->tables[i].tag;
-        switch (tableTag) {
-            case 'OS/2':
-                {
-                    if (dataLength < tableOffset + sizeof(OS2Table))
-                        return false;
-
-                    haveOS2 = true;
-                    const OS2Table* OS2 = reinterpret_cast<const OS2Table*>(data + tableOffset);
-                    for (unsigned j = 0; j < 10; j++)
-                        prefix->fontPANOSE[j] = OS2->panose[j];
-                    prefix->italic = OS2->fsSelection & 0x01;
-                    prefix->weight = OS2->weightClass;
-                    // FIXME: Should use OS2->fsType, but some TrueType fonts set it to an over-restrictive value.
-                    // Since ATS does not enforce this on Mac OS X, we do not enforce it either.
-                    prefix->fsType = 0;            
-                    for (unsigned j = 0; j < 4; j++)
-                        prefix->unicodeRange[j] = OS2->unicodeRange[j];
-                    for (unsigned j = 0; j < 2; j++)
-                        prefix->codePageRange[j] = OS2->codePageRange[j];
-                    break;
-                }
-            case 'head':
-                {
-                    if (dataLength < tableOffset + sizeof(headTable))
-                        return false;
-
-                    haveHead = true;
-                    const headTable* head = reinterpret_cast<const headTable*>(data + tableOffset);
-                    prefix->checkSumAdjustment = head->checkSumAdjustment;
-                    break;
-                }
-            case 'name':
-                {
-                    if (dataLength < tableOffset + offsetof(nameTable, nameRecords))
-                        return false;
-
-                    haveName = true;
-                    const nameTable* name = reinterpret_cast<const nameTable*>(data + tableOffset);
-                    for (int j = 0; j < name->count; j++) {
-                        if (dataLength < tableOffset + offsetof(nameTable, nameRecords) + (j + 1) * sizeof(nameRecord))
-                            return false;
-                        if (name->nameRecords[j].platformID == 3 && name->nameRecords[j].encodingID == 1 && name->nameRecords[j].languageID == 0x0409) {
-                            if (dataLength < tableOffset + name->stringOffset + name->nameRecords[j].offset + name->nameRecords[j].length)
-                                return false;
-
-                            unsigned short nameLength = name->nameRecords[j].length;
-                            const BigEndianUShort* nameString = reinterpret_cast<const BigEndianUShort*>(data + tableOffset + name->stringOffset + name->nameRecords[j].offset);
-                            
-                            switch (name->nameRecords[j].nameID) {
-                                case 1:
-                                    familyNameLength = nameLength;
-                                    familyName = nameString;
-                                    break;
-                                case 2:
-                                    subfamilyNameLength = nameLength;
-                                    subfamilyName = nameString;
-                                    break;
-                                case 4:
-                                    fullNameLength = nameLength;
-                                    fullName = nameString;
-                                    break;
-                                case 5:
-                                    versionStringLength = nameLength;
-                                    versionString = nameString;
-                                    break;
-                                default:
-                                    break;
-                            }
-                        }
-                    }
-                    break;
-                }
-            default:
-                break;
-        }
-        if (haveOS2 && haveHead && haveName)
-            break;
-    }
-
-    prefix->charset = DEFAULT_CHARSET;
-    prefix->magicNumber = 0x504c;
-    prefix->reserved[0] = 0;
-    prefix->reserved[1] = 0;
-    prefix->reserved[2] = 0;
-    prefix->reserved[3] = 0;
-    prefix->padding1 = 0;
-
-    eotHeader.appendBigEndianString(familyName, familyNameLength);
-    eotHeader.appendBigEndianString(subfamilyName, subfamilyNameLength);
-    eotHeader.appendBigEndianString(versionString, versionStringLength);
-
-    // If possible, ensure that the family name is a prefix of the full name.
-    if (fullNameLength >= familyNameLength && memcmp(familyName, fullName, familyNameLength)) {
-        overlaySrc = reinterpret_cast<const uint8_t*>(fullName) - data;
-        overlayDst = reinterpret_cast<const uint8_t*>(familyName) - data;
-        overlayLength = familyNameLength;
-    }
-    eotHeader.appendBigEndianString(fullName, fullNameLength);
-
-    eotHeader.appendPaddingShort();
-    eotHeader.updateEOTSize(fontData->size());
-
-    return true;
-}
-
</del><span class="cx"> // adds fontName to the font table in fontData, and writes the new font table to rewrittenFontTable
</span><span class="cx"> // returns the size of the name table (which is used by renameAndActivateFont), or 0 on early abort
</span><span class="cx"> bool renameFont(const SharedBuffer& fontData, const String& fontName, Vector<uint8_t>& rewrittenFontData)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsopentypeOpenTypeUtilitiesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/opentype/OpenTypeUtilities.h (286116 => 286117)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/opentype/OpenTypeUtilities.h      2021-11-22 20:34:19 UTC (rev 286116)
+++ trunk/Source/WebCore/platform/graphics/opentype/OpenTypeUtilities.h 2021-11-22 20:35:05 UTC (rev 286117)
</span><span class="lines">@@ -54,7 +54,6 @@
</span><span class="cx">     Vector<uint8_t, 512> m_buffer;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-bool getEOTHeader(SharedBuffer* fontData, EOTHeader& eotHeader, size_t& overlayDst, size_t& overlaySrc, size_t& overlayLength);
</del><span class="cx"> bool renameFont(const SharedBuffer&, const String&, Vector<uint8_t>&);
</span><span class="cx"> RefPtr<FontMemoryResource> renameAndActivateFont(const SharedBuffer&, const String&);
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>