Rename FPDFFont_GetBaseName() to FPDFFont_GetBaseFontName()

Despite having "Font" twice in the name, the longer name should be more
intuitive, as the font dictionary field associated with this API is
BaseFont. Mention that in the API description in the public header.

Bug: 353746891
Change-Id: I157f382c6bf9624efab3dda34469ea54a9ed4a17
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/122550
Reviewed-by: Tom Sepez <tsepez@google.com>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/fpdfsdk/fpdf_edit_embeddertest.cpp b/fpdfsdk/fpdf_edit_embeddertest.cpp
index fba054b..fde48f1 100644
--- a/fpdfsdk/fpdf_edit_embeddertest.cpp
+++ b/fpdfsdk/fpdf_edit_embeddertest.cpp
@@ -2924,7 +2924,7 @@
 TEST_F(FPDFEditEmbedderTest, TextFontProperties) {
   // bad object tests
   EXPECT_FALSE(FPDFTextObj_GetFont(nullptr));
-  EXPECT_EQ(0U, FPDFFont_GetBaseName(nullptr, nullptr, 5));
+  EXPECT_EQ(0U, FPDFFont_GetBaseFontName(nullptr, nullptr, 5));
   EXPECT_EQ(0U, FPDFFont_GetFamilyName(nullptr, nullptr, 5));
   EXPECT_EQ(-1, FPDFFont_GetFlags(nullptr));
   EXPECT_EQ(-1, FPDFFont_GetWeight(nullptr));
@@ -2978,21 +2978,21 @@
   }
 
   {
-    // FPDFFont_GetBaseName() positive testing.
-    unsigned long size = FPDFFont_GetBaseName(font, nullptr, 0);
+    // FPDFFont_GetBaseFontName() positive testing.
+    unsigned long size = FPDFFont_GetBaseFontName(font, nullptr, 0);
     const char kExpectedFontName[] = "LiberationSerif";
     ASSERT_EQ(sizeof(kExpectedFontName), size);
     std::vector<char> font_name(size);
-    ASSERT_EQ(size, FPDFFont_GetBaseName(font, font_name.data(), size));
+    ASSERT_EQ(size, FPDFFont_GetBaseFontName(font, font_name.data(), size));
     ASSERT_STREQ(kExpectedFontName, font_name.data());
 
-    // FPDFFont_GetBaseName() negative testing.
-    ASSERT_EQ(0U, FPDFFont_GetBaseName(nullptr, nullptr, 0));
+    // FPDFFont_GetBaseFontName() negative testing.
+    ASSERT_EQ(0U, FPDFFont_GetBaseFontName(nullptr, nullptr, 0));
 
     font_name.resize(2);
     font_name[0] = 'x';
     font_name[1] = '\0';
-    size = FPDFFont_GetBaseName(font, font_name.data(), font_name.size());
+    size = FPDFFont_GetBaseFontName(font, font_name.data(), font_name.size());
     ASSERT_EQ(sizeof(kExpectedFontName), size);
     ASSERT_STREQ("x", font_name.data());
   }
diff --git a/fpdfsdk/fpdf_edittext.cpp b/fpdfsdk/fpdf_edittext.cpp
index 482f845..18e5b04 100644
--- a/fpdfsdk/fpdf_edittext.cpp
+++ b/fpdfsdk/fpdf_edittext.cpp
@@ -849,9 +849,9 @@
   return FPDFFontFromCPDFFont(pTextObj->GetFont());
 }
 
-FPDF_EXPORT size_t FPDF_CALLCONV FPDFFont_GetBaseName(FPDF_FONT font,
-                                                      char* buffer,
-                                                      size_t length) {
+FPDF_EXPORT size_t FPDF_CALLCONV FPDFFont_GetBaseFontName(FPDF_FONT font,
+                                                          char* buffer,
+                                                          size_t length) {
   auto* cfont = CPDFFontFromFPDFFont(font);
   if (!cfont) {
     return 0;
diff --git a/fpdfsdk/fpdf_view_c_api_test.c b/fpdfsdk/fpdf_view_c_api_test.c
index 7018331..a440d79 100644
--- a/fpdfsdk/fpdf_view_c_api_test.c
+++ b/fpdfsdk/fpdf_view_c_api_test.c
@@ -163,7 +163,7 @@
     // fpdf_edit.h
     CHK(FPDFFont_Close);
     CHK(FPDFFont_GetAscent);
-    CHK(FPDFFont_GetBaseName);
+    CHK(FPDFFont_GetBaseFontName);
     CHK(FPDFFont_GetDescent);
     CHK(FPDFFont_GetFamilyName);
     CHK(FPDFFont_GetFlags);
diff --git a/public/fpdf_edit.h b/public/fpdf_edit.h
index 19eee7f..f4e08c7 100644
--- a/public/fpdf_edit.h
+++ b/public/fpdf_edit.h
@@ -1373,14 +1373,14 @@
 //
 // Returns the number of bytes in the base name (including the trailing NUL
 // character) on success, 0 on error. The base name is typically the font's
-// PostScript name.
+// PostScript name. See descriptions of "BaseFont" in ISO 32000-1:2008 spec.
 //
 // Regardless of the platform, the |buffer| is always in UTF-8 encoding.
 // If |length| is less than the returned length, or |buffer| is NULL, |buffer|
 // will not be modified.
-FPDF_EXPORT size_t FPDF_CALLCONV FPDFFont_GetBaseName(FPDF_FONT font,
-                                                      char* buffer,
-                                                      size_t length);
+FPDF_EXPORT size_t FPDF_CALLCONV FPDFFont_GetBaseFontName(FPDF_FONT font,
+                                                          char* buffer,
+                                                          size_t length);
 
 // Experimental API.
 // Get the family name of a font.