diff --git a/fpdfsdk/cba_annotiterator.cpp b/fpdfsdk/cba_annotiterator.cpp
index 409a928..3e35ff8 100644
--- a/fpdfsdk/cba_annotiterator.cpp
+++ b/fpdfsdk/cba_annotiterator.cpp
@@ -113,7 +113,7 @@
 
       while (!sa.empty()) {
         int nLeftTopIndex = -1;
-        FX_FLOAT fTop = 0.0f;
+        float fTop = 0.0f;
         for (int i = sa.size() - 1; i >= 0; i--) {
           CFX_FloatRect rcAnnot = GetAnnotRect(sa[i]);
           if (rcAnnot.top > fTop) {
@@ -129,7 +129,7 @@
         std::vector<size_t> aSelect;
         for (size_t i = 0; i < sa.size(); ++i) {
           CFX_FloatRect rcAnnot = GetAnnotRect(sa[i]);
-          FX_FLOAT fCenterY = (rcAnnot.top + rcAnnot.bottom) / 2.0f;
+          float fCenterY = (rcAnnot.top + rcAnnot.bottom) / 2.0f;
           if (fCenterY > rcLeftTop.bottom && fCenterY < rcLeftTop.top)
             aSelect.push_back(i);
         }
@@ -145,7 +145,7 @@
 
       while (!sa.empty()) {
         int nLeftTopIndex = -1;
-        FX_FLOAT fLeft = -1.0f;
+        float fLeft = -1.0f;
         for (int i = sa.size() - 1; i >= 0; --i) {
           CFX_FloatRect rcAnnot = GetAnnotRect(sa[i]);
           if (fLeft < 0) {
@@ -164,7 +164,7 @@
         std::vector<size_t> aSelect;
         for (size_t i = 0; i < sa.size(); ++i) {
           CFX_FloatRect rcAnnot = GetAnnotRect(sa[i]);
-          FX_FLOAT fCenterX = (rcAnnot.left + rcAnnot.right) / 2.0f;
+          float fCenterX = (rcAnnot.left + rcAnnot.right) / 2.0f;
           if (fCenterX > rcLeftTop.left && fCenterX < rcLeftTop.right)
             aSelect.push_back(i);
         }
diff --git a/fpdfsdk/cfx_systemhandler.cpp b/fpdfsdk/cfx_systemhandler.cpp
index b6dc19d..ea64412 100644
--- a/fpdfsdk/cfx_systemhandler.cpp
+++ b/fpdfsdk/cfx_systemhandler.cpp
@@ -46,10 +46,10 @@
   CFX_Matrix device2page;
   device2page.SetReverse(page2device);
 
-  CFX_PointF left_top = device2page.Transform(CFX_PointF(
-      static_cast<FX_FLOAT>(rect.left), static_cast<FX_FLOAT>(rect.top)));
+  CFX_PointF left_top = device2page.Transform(
+      CFX_PointF(static_cast<float>(rect.left), static_cast<float>(rect.top)));
   CFX_PointF right_bottom = device2page.Transform(CFX_PointF(
-      static_cast<FX_FLOAT>(rect.right), static_cast<FX_FLOAT>(rect.bottom)));
+      static_cast<float>(rect.right), static_cast<float>(rect.bottom)));
 
   CFX_FloatRect rcPDF(left_top.x, right_bottom.y, right_bottom.x, left_top.y);
   rcPDF.Normalize();
diff --git a/fpdfsdk/cpdfsdk_annot.cpp b/fpdfsdk/cpdfsdk_annot.cpp
index 4dcce48..dcfcac9 100644
--- a/fpdfsdk/cpdfsdk_annot.cpp
+++ b/fpdfsdk/cpdfsdk_annot.cpp
@@ -43,11 +43,11 @@
 
 #endif  // PDF_ENABLE_XFA
 
-FX_FLOAT CPDFSDK_Annot::GetMinWidth() const {
+float CPDFSDK_Annot::GetMinWidth() const {
   return kMinWidth;
 }
 
-FX_FLOAT CPDFSDK_Annot::GetMinHeight() const {
+float CPDFSDK_Annot::GetMinHeight() const {
   return kMinHeight;
 }
 
diff --git a/fpdfsdk/cpdfsdk_annot.h b/fpdfsdk/cpdfsdk_annot.h
index 36e7b56..1053c00 100644
--- a/fpdfsdk/cpdfsdk_annot.h
+++ b/fpdfsdk/cpdfsdk_annot.h
@@ -32,8 +32,8 @@
   virtual CXFA_FFWidget* GetXFAWidget() const;
 #endif  // PDF_ENABLE_XFA
 
-  virtual FX_FLOAT GetMinWidth() const;
-  virtual FX_FLOAT GetMinHeight() const;
+  virtual float GetMinWidth() const;
+  virtual float GetMinHeight() const;
   virtual int GetLayoutOrder() const;
   virtual CPDF_Annot* GetPDFAnnot() const;
   virtual CPDF_Annot::Subtype GetAnnotSubtype() const;
diff --git a/fpdfsdk/cpdfsdk_baannot.cpp b/fpdfsdk/cpdfsdk_baannot.cpp
index 3c96550..129491c 100644
--- a/fpdfsdk/cpdfsdk_baannot.cpp
+++ b/fpdfsdk/cpdfsdk_baannot.cpp
@@ -245,11 +245,11 @@
 
 void CPDFSDK_BAAnnot::SetColor(FX_COLORREF color) {
   CPDF_Array* pArray = m_pAnnot->GetAnnotDict()->SetNewFor<CPDF_Array>("C");
-  pArray->AddNew<CPDF_Number>(static_cast<FX_FLOAT>(FXSYS_GetRValue(color)) /
+  pArray->AddNew<CPDF_Number>(static_cast<float>(FXSYS_GetRValue(color)) /
                               255.0f);
-  pArray->AddNew<CPDF_Number>(static_cast<FX_FLOAT>(FXSYS_GetGValue(color)) /
+  pArray->AddNew<CPDF_Number>(static_cast<float>(FXSYS_GetGValue(color)) /
                               255.0f);
-  pArray->AddNew<CPDF_Number>(static_cast<FX_FLOAT>(FXSYS_GetBValue(color)) /
+  pArray->AddNew<CPDF_Number>(static_cast<float>(FXSYS_GetBValue(color)) /
                               255.0f);
 }
 
@@ -261,28 +261,28 @@
   if (CPDF_Array* pEntry = m_pAnnot->GetAnnotDict()->GetArrayFor("C")) {
     size_t nCount = pEntry->GetCount();
     if (nCount == 1) {
-      FX_FLOAT g = pEntry->GetNumberAt(0) * 255;
+      float g = pEntry->GetNumberAt(0) * 255;
 
       color = FXSYS_RGB((int)g, (int)g, (int)g);
 
       return true;
     } else if (nCount == 3) {
-      FX_FLOAT r = pEntry->GetNumberAt(0) * 255;
-      FX_FLOAT g = pEntry->GetNumberAt(1) * 255;
-      FX_FLOAT b = pEntry->GetNumberAt(2) * 255;
+      float r = pEntry->GetNumberAt(0) * 255;
+      float g = pEntry->GetNumberAt(1) * 255;
+      float b = pEntry->GetNumberAt(2) * 255;
 
       color = FXSYS_RGB((int)r, (int)g, (int)b);
 
       return true;
     } else if (nCount == 4) {
-      FX_FLOAT c = pEntry->GetNumberAt(0);
-      FX_FLOAT m = pEntry->GetNumberAt(1);
-      FX_FLOAT y = pEntry->GetNumberAt(2);
-      FX_FLOAT k = pEntry->GetNumberAt(3);
+      float c = pEntry->GetNumberAt(0);
+      float m = pEntry->GetNumberAt(1);
+      float y = pEntry->GetNumberAt(2);
+      float k = pEntry->GetNumberAt(3);
 
-      FX_FLOAT r = 1.0f - std::min(1.0f, c + k);
-      FX_FLOAT g = 1.0f - std::min(1.0f, m + k);
-      FX_FLOAT b = 1.0f - std::min(1.0f, y + k);
+      float r = 1.0f - std::min(1.0f, c + k);
+      float g = 1.0f - std::min(1.0f, m + k);
+      float b = 1.0f - std::min(1.0f, y + k);
 
       color = FXSYS_RGB((int)(r * 255), (int)(g * 255), (int)(b * 255));
 
diff --git a/fpdfsdk/cpdfsdk_pageview.cpp b/fpdfsdk/cpdfsdk_pageview.cpp
index c67948d..d5a04fe 100644
--- a/fpdfsdk/cpdfsdk_pageview.cpp
+++ b/fpdfsdk/cpdfsdk_pageview.cpp
@@ -96,10 +96,9 @@
 
   if (pPage->GetContext()->GetDocType() == DOCTYPE_DYNAMIC_XFA) {
     CFX_Graphics gs(pDevice);
-    CFX_RectF rectClip(static_cast<FX_FLOAT>(pClip.left),
-                       static_cast<FX_FLOAT>(pClip.top),
-                       static_cast<FX_FLOAT>(pClip.Width()),
-                       static_cast<FX_FLOAT>(pClip.Height()));
+    CFX_RectF rectClip(
+        static_cast<float>(pClip.left), static_cast<float>(pClip.top),
+        static_cast<float>(pClip.Width()), static_cast<float>(pClip.Height()));
     gs.SetClipRect(rectClip);
     std::unique_ptr<CXFA_RenderContext> pRenderContext(new CXFA_RenderContext);
     CXFA_RenderOptions renderOptions;
diff --git a/fpdfsdk/cpdfsdk_widget.cpp b/fpdfsdk/cpdfsdk_widget.cpp
index e5df453..75c34b3 100644
--- a/fpdfsdk/cpdfsdk_widget.cpp
+++ b/fpdfsdk/cpdfsdk_widget.cpp
@@ -584,11 +584,11 @@
   return iColorType != COLORTYPE_TRANSPARENT;
 }
 
-FX_FLOAT CPDFSDK_Widget::GetFontSize() const {
+float CPDFSDK_Widget::GetFontSize() const {
   CPDF_FormControl* pFormCtrl = GetFormControl();
   CPDF_DefaultAppearance pDa = pFormCtrl->GetDefaultAppearance();
   CFX_ByteString csFont = "";
-  FX_FLOAT fFontSize = 0.0f;
+  float fFontSize = 0.0f;
   pDa.GetFont(csFont, fFontSize);
 
   return fFontSize;
@@ -892,7 +892,7 @@
   CPWL_Color crBackground;
   CPWL_Color crBorder;
   int iColorType;
-  FX_FLOAT fc[4];
+  float fc[4];
   pControl->GetOriginalBackgroundColor(iColorType, fc);
   if (iColorType > 0)
     crBackground = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
@@ -901,7 +901,7 @@
   if (iColorType > 0)
     crBorder = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
 
-  FX_FLOAT fBorderWidth = (FX_FLOAT)GetBorderWidth();
+  float fBorderWidth = (float)GetBorderWidth();
   CPWL_Dash dsBorder(3, 0, 0);
   CPWL_Color crLeftTop;
   CPWL_Color crRightBottom;
@@ -929,7 +929,7 @@
 
   CPWL_Color crText(COLORTYPE_GRAY, 0);
 
-  FX_FLOAT fFontSize = 12.0f;
+  float fFontSize = 12.0f;
   CFX_ByteString csNameTag;
 
   CPDF_DefaultAppearance da = pControl->GetDefaultAppearance();
@@ -1071,7 +1071,7 @@
   CPDF_FormControl* pControl = GetFormControl();
   CPWL_Color crBackground, crBorder, crText;
   int iColorType;
-  FX_FLOAT fc[4];
+  float fc[4];
 
   pControl->GetOriginalBackgroundColor(iColorType, fc);
   if (iColorType > 0)
@@ -1081,7 +1081,7 @@
   if (iColorType > 0)
     crBorder = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
 
-  FX_FLOAT fBorderWidth = (FX_FLOAT)GetBorderWidth();
+  float fBorderWidth = (float)GetBorderWidth();
   CPWL_Dash dsBorder(3, 0, 0);
   CPWL_Color crLeftTop, crRightBottom;
 
@@ -1191,7 +1191,7 @@
   CPDF_FormControl* pControl = GetFormControl();
   CPWL_Color crBackground, crBorder, crText;
   int iColorType;
-  FX_FLOAT fc[4];
+  float fc[4];
 
   pControl->GetOriginalBackgroundColor(iColorType, fc);
   if (iColorType > 0)
@@ -1201,7 +1201,7 @@
   if (iColorType > 0)
     crBorder = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
 
-  FX_FLOAT fBorderWidth = (FX_FLOAT)GetBorderWidth();
+  float fBorderWidth = (float)GetBorderWidth();
   CPWL_Dash dsBorder(3, 0, 0);
   CPWL_Color crLeftTop;
   CPWL_Color crRightBottom;
@@ -1369,7 +1369,7 @@
   pEdit->SetPlateRect(rcEdit);
   pEdit->SetAlignmentV(1, true);
 
-  FX_FLOAT fFontSize = GetFontSize();
+  float fFontSize = GetFontSize();
   if (IsFloatZero(fFontSize))
     pEdit->SetAutoFontSize(true, true);
   else
@@ -1428,14 +1428,14 @@
 
   pEdit->SetPlateRect(CFX_FloatRect(rcClient.left, 0.0f, rcClient.right, 0.0f));
 
-  FX_FLOAT fFontSize = GetFontSize();
+  float fFontSize = GetFontSize();
 
   pEdit->SetFontSize(IsFloatZero(fFontSize) ? 12.0f : fFontSize);
 
   pEdit->Initialize();
 
   CFX_ByteTextBuf sList;
-  FX_FLOAT fy = rcClient.top;
+  float fy = rcClient.top;
 
   int32_t nTop = pField->GetTopVisibleIndex();
   int32_t nCount = pField->CountOptions();
@@ -1453,7 +1453,7 @@
     pEdit->SetText(pField->GetOptionLabel(i));
 
     CFX_FloatRect rcContent = pEdit->GetContentRect();
-    FX_FLOAT fItemHeight = rcContent.Height();
+    float fItemHeight = rcContent.Height();
 
     if (bSelected) {
       CFX_FloatRect rcItem =
@@ -1530,7 +1530,7 @@
 
   int nMaxLen = pField->GetMaxLen();
   bool bCharArray = (dwFieldFlags >> 24) & 1;
-  FX_FLOAT fFontSize = GetFontSize();
+  float fFontSize = GetFontSize();
 
 #ifdef PDF_ENABLE_XFA
   CFX_WideString sValueTmp;
@@ -1642,7 +1642,7 @@
 
 CFX_FloatRect CPDFSDK_Widget::GetClientRect() const {
   CFX_FloatRect rcWindow = GetRotatedRect();
-  FX_FLOAT fBorderWidth = (FX_FLOAT)GetBorderWidth();
+  float fBorderWidth = (float)GetBorderWidth();
   switch (GetBorderStyle()) {
     case BorderStyle::BEVELED:
     case BorderStyle::INSET:
@@ -1657,8 +1657,8 @@
 
 CFX_FloatRect CPDFSDK_Widget::GetRotatedRect() const {
   CFX_FloatRect rectAnnot = GetRect();
-  FX_FLOAT fWidth = rectAnnot.right - rectAnnot.left;
-  FX_FLOAT fHeight = rectAnnot.top - rectAnnot.bottom;
+  float fWidth = rectAnnot.right - rectAnnot.left;
+  float fHeight = rectAnnot.top - rectAnnot.bottom;
 
   CPDF_FormControl* pControl = GetFormControl();
   CFX_FloatRect rcPDFWindow;
@@ -1691,7 +1691,7 @@
   CPWL_Color crBackground = GetFillPWLColor();
   CPWL_Color crLeftTop, crRightBottom;
 
-  FX_FLOAT fBorderWidth = (FX_FLOAT)GetBorderWidth();
+  float fBorderWidth = (float)GetBorderWidth();
   CPWL_Dash dsBorder(3, 0, 0);
 
   BorderStyle nBorderStyle = GetBorderStyle();
@@ -1722,8 +1722,8 @@
   CFX_Matrix mt;
   CPDF_FormControl* pControl = GetFormControl();
   CFX_FloatRect rcAnnot = GetRect();
-  FX_FLOAT fWidth = rcAnnot.right - rcAnnot.left;
-  FX_FLOAT fHeight = rcAnnot.top - rcAnnot.bottom;
+  float fWidth = rcAnnot.right - rcAnnot.left;
+  float fHeight = rcAnnot.top - rcAnnot.bottom;
 
   switch (abs(pControl->GetRotation() % 360)) {
     case 0:
@@ -1751,7 +1751,7 @@
   CPDF_DefaultAppearance da = pFormCtrl->GetDefaultAppearance();
   if (da.HasColor()) {
     int32_t iColorType;
-    FX_FLOAT fc[4];
+    float fc[4];
     da.GetColor(iColorType, fc);
     crText = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
   }
@@ -1764,7 +1764,7 @@
 
   CPDF_FormControl* pFormCtrl = GetFormControl();
   int32_t iColorType;
-  FX_FLOAT fc[4];
+  float fc[4];
   pFormCtrl->GetOriginalBorderColor(iColorType, fc);
   if (iColorType > 0)
     crBorder = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
@@ -1777,7 +1777,7 @@
 
   CPDF_FormControl* pFormCtrl = GetFormControl();
   int32_t iColorType;
-  FX_FLOAT fc[4];
+  float fc[4];
   pFormCtrl->GetOriginalBackgroundColor(iColorType, fc);
   if (iColorType > 0)
     crFill = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
diff --git a/fpdfsdk/cpdfsdk_widget.h b/fpdfsdk/cpdfsdk_widget.h
index 21e5169..9f58cc1 100644
--- a/fpdfsdk/cpdfsdk_widget.h
+++ b/fpdfsdk/cpdfsdk_widget.h
@@ -77,7 +77,7 @@
   bool GetFillColor(FX_COLORREF& color) const;
   bool GetBorderColor(FX_COLORREF& color) const;
   bool GetTextColor(FX_COLORREF& color) const;
-  FX_FLOAT GetFontSize() const;
+  float GetFontSize() const;
 
   int GetSelectedIndex(int nIndex) const;
 #ifndef PDF_ENABLE_XFA
diff --git a/fpdfsdk/formfiller/cffl_formfiller.cpp b/fpdfsdk/formfiller/cffl_formfiller.cpp
index da6f920..947c495 100644
--- a/fpdfsdk/formfiller/cffl_formfiller.cpp
+++ b/fpdfsdk/formfiller/cffl_formfiller.cpp
@@ -438,8 +438,8 @@
 CFX_FloatRect CFFL_FormFiller::GetPDFWindowRect() const {
   CFX_FloatRect rectAnnot = m_pWidget->GetPDFAnnot()->GetRect();
 
-  FX_FLOAT fWidth = rectAnnot.right - rectAnnot.left;
-  FX_FLOAT fHeight = rectAnnot.top - rectAnnot.bottom;
+  float fWidth = rectAnnot.right - rectAnnot.left;
+  float fHeight = rectAnnot.top - rectAnnot.bottom;
   if ((m_pWidget->GetRotate() / 90) & 0x01)
     return CFX_FloatRect(0, 0, fHeight, fWidth);
 
diff --git a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
index a830d52..4cebc83 100644
--- a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
+++ b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
@@ -527,10 +527,10 @@
 }
 
 void CFFL_InteractiveFormFiller::QueryWherePopup(void* pPrivateData,
-                                                 FX_FLOAT fPopupMin,
-                                                 FX_FLOAT fPopupMax,
+                                                 float fPopupMin,
+                                                 float fPopupMax,
                                                  int32_t& nRet,
-                                                 FX_FLOAT& fPopupRet) {
+                                                 float& fPopupRet) {
   CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData;
 
   CFX_FloatRect rcPageView(0, 0, 0, 0);
@@ -540,8 +540,8 @@
 
   CFX_FloatRect rcAnnot = pData->pWidget->GetRect();
 
-  FX_FLOAT fTop = 0.0f;
-  FX_FLOAT fBottom = 0.0f;
+  float fTop = 0.0f;
+  float fBottom = 0.0f;
 
   CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pData->pWidget;
   switch (pWidget->GetRotate() / 90) {
@@ -564,9 +564,9 @@
       break;
   }
 
-  FX_FLOAT fFactHeight = 0;
+  float fFactHeight = 0;
   bool bBottom = true;
-  FX_FLOAT fMaxListBoxHeight = 0;
+  float fMaxListBoxHeight = 0;
   if (fPopupMax > FFL_MAXLISTBOXHEIGHT) {
     if (fPopupMin > FFL_MAXLISTBOXHEIGHT) {
       fMaxListBoxHeight = fPopupMin;
diff --git a/fpdfsdk/formfiller/cffl_interactiveformfiller.h b/fpdfsdk/formfiller/cffl_interactiveformfiller.h
index 90fd98c..3c23a6e 100644
--- a/fpdfsdk/formfiller/cffl_interactiveformfiller.h
+++ b/fpdfsdk/formfiller/cffl_interactiveformfiller.h
@@ -139,10 +139,10 @@
 
   // IPWL_Filler_Notify:
   void QueryWherePopup(void* pPrivateData,
-                       FX_FLOAT fPopupMin,
-                       FX_FLOAT fPopupMax,
+                       float fPopupMin,
+                       float fPopupMax,
                        int32_t& nRet,
-                       FX_FLOAT& fPopupRet) override;
+                       float& fPopupRet) override;
   void OnBeforeKeyStroke(void* pPrivateData,
                          CFX_WideString& strChange,
                          const CFX_WideString& strChangeEx,
diff --git a/fpdfsdk/fpdf_flatten.cpp b/fpdfsdk/fpdf_flatten.cpp
index 06ea939..c43412c 100644
--- a/fpdfsdk/fpdf_flatten.cpp
+++ b/fpdfsdk/fpdf_flatten.cpp
@@ -123,14 +123,14 @@
   return FLATTEN_SUCCESS;
 }
 
-FX_FLOAT GetMinMaxValue(const std::vector<CFX_FloatRect>& array,
-                        FPDF_TYPE type,
-                        FPDF_VALUE value) {
+float GetMinMaxValue(const std::vector<CFX_FloatRect>& array,
+                     FPDF_TYPE type,
+                     FPDF_VALUE value) {
   size_t nRects = array.size();
   if (nRects <= 0)
     return 0.0f;
 
-  std::vector<FX_FLOAT> pArray(nRects);
+  std::vector<float> pArray(nRects);
   switch (value) {
     case LEFT:
       for (size_t i = 0; i < nRects; i++)
@@ -153,7 +153,7 @@
       return 0.0f;
   }
 
-  FX_FLOAT fRet = pArray[0];
+  float fRet = pArray[0];
   if (type == MAX) {
     for (size_t i = 1; i < nRects; i++)
       fRet = std::max(fRet, pArray[i]);
@@ -231,11 +231,11 @@
   matrix.TransformRect(rcStream);
   rcStream.Normalize();
 
-  FX_FLOAT a = rcAnnot.Width() / rcStream.Width();
-  FX_FLOAT d = rcAnnot.Height() / rcStream.Height();
+  float a = rcAnnot.Width() / rcStream.Width();
+  float d = rcAnnot.Height() / rcStream.Height();
 
-  FX_FLOAT e = rcAnnot.left - rcStream.left * a;
-  FX_FLOAT f = rcAnnot.bottom - rcStream.bottom * d;
+  float e = rcAnnot.left - rcStream.left * a;
+  float f = rcAnnot.bottom - rcStream.bottom * d;
   return CFX_Matrix(a, 0, 0, d, e, f);
 }
 
diff --git a/fpdfsdk/fpdf_transformpage.cpp b/fpdfsdk/fpdf_transformpage.cpp
index 3427f4e..32ba3a7 100644
--- a/fpdfsdk/fpdf_transformpage.cpp
+++ b/fpdfsdk/fpdf_transformpage.cpp
@@ -206,8 +206,7 @@
   CPDF_PageObject* pPageObj = (CPDF_PageObject*)page_object;
   if (!pPageObj)
     return;
-  CFX_Matrix matrix((FX_FLOAT)a, (FX_FLOAT)b, (FX_FLOAT)c, (FX_FLOAT)d,
-                    (FX_FLOAT)e, (FX_FLOAT)f);
+  CFX_Matrix matrix((float)a, (float)b, (float)c, (float)d, (float)e, (float)f);
 
   // Special treatment to shading object, because the ClipPath for shading
   // object is already transformed.
diff --git a/fpdfsdk/fpdfdoc.cpp b/fpdfsdk/fpdfdoc.cpp
index f7d94c2..39c7602 100644
--- a/fpdfsdk/fpdfdoc.cpp
+++ b/fpdfsdk/fpdfdoc.cpp
@@ -258,9 +258,9 @@
     return nullptr;
 
   return pLinkList
-      ->GetLinkAtPoint(
-          pPage, CFX_PointF(static_cast<FX_FLOAT>(x), static_cast<FX_FLOAT>(y)),
-          nullptr)
+      ->GetLinkAtPoint(pPage,
+                       CFX_PointF(static_cast<float>(x), static_cast<float>(y)),
+                       nullptr)
       .GetDict();
 }
 
@@ -277,7 +277,7 @@
 
   int z_order = -1;
   pLinkList->GetLinkAtPoint(
-      pPage, CFX_PointF(static_cast<FX_FLOAT>(x), static_cast<FX_FLOAT>(y)),
+      pPage, CFX_PointF(static_cast<float>(x), static_cast<float>(y)),
       &z_order);
   return z_order;
 }
diff --git a/fpdfsdk/fpdfeditimg.cpp b/fpdfsdk/fpdfeditimg.cpp
index 56875e2..ad56050 100644
--- a/fpdfsdk/fpdfeditimg.cpp
+++ b/fpdfsdk/fpdfeditimg.cpp
@@ -78,10 +78,9 @@
     return false;
 
   CPDF_ImageObject* pImgObj = reinterpret_cast<CPDF_ImageObject*>(image_object);
-  pImgObj->set_matrix(
-      CFX_Matrix(static_cast<FX_FLOAT>(a), static_cast<FX_FLOAT>(b),
-                 static_cast<FX_FLOAT>(c), static_cast<FX_FLOAT>(d),
-                 static_cast<FX_FLOAT>(e), static_cast<FX_FLOAT>(f)));
+  pImgObj->set_matrix(CFX_Matrix(static_cast<float>(a), static_cast<float>(b),
+                                 static_cast<float>(c), static_cast<float>(d),
+                                 static_cast<float>(e), static_cast<float>(f)));
   pImgObj->CalcBoundingBox();
   return true;
 }
diff --git a/fpdfsdk/fpdfeditpage.cpp b/fpdfsdk/fpdfeditpage.cpp
index 63740ba..cff339c 100644
--- a/fpdfsdk/fpdfeditpage.cpp
+++ b/fpdfsdk/fpdfeditpage.cpp
@@ -112,8 +112,8 @@
   CPDF_Array* pMediaBoxArray = pPageDict->SetNewFor<CPDF_Array>("MediaBox");
   pMediaBoxArray->AddNew<CPDF_Number>(0);
   pMediaBoxArray->AddNew<CPDF_Number>(0);
-  pMediaBoxArray->AddNew<CPDF_Number>(static_cast<FX_FLOAT>(width));
-  pMediaBoxArray->AddNew<CPDF_Number>(static_cast<FX_FLOAT>(height));
+  pMediaBoxArray->AddNew<CPDF_Number>(static_cast<float>(width));
+  pMediaBoxArray->AddNew<CPDF_Number>(static_cast<float>(height));
   pPageDict->SetNewFor<CPDF_Number>("Rotate", 0);
   pPageDict->SetNewFor<CPDF_Dictionary>("Resources");
 
@@ -267,8 +267,7 @@
   if (!pPageObj)
     return;
 
-  CFX_Matrix matrix((FX_FLOAT)a, (FX_FLOAT)b, (FX_FLOAT)c, (FX_FLOAT)d,
-                    (FX_FLOAT)e, (FX_FLOAT)f);
+  CFX_Matrix matrix((float)a, (float)b, (float)c, (float)d, (float)e, (float)f);
   pPageObj->Transform(matrix);
 }
 
@@ -287,8 +286,8 @@
   for (size_t i = 0; i < AnnotList.Count(); ++i) {
     CPDF_Annot* pAnnot = AnnotList.GetAt(i);
     CFX_FloatRect rect = pAnnot->GetRect();  // transformAnnots Rectangle
-    CFX_Matrix matrix((FX_FLOAT)a, (FX_FLOAT)b, (FX_FLOAT)c, (FX_FLOAT)d,
-                      (FX_FLOAT)e, (FX_FLOAT)f);
+    CFX_Matrix matrix((float)a, (float)b, (float)c, (float)d, (float)e,
+                      (float)f);
     matrix.TransformRect(rect);
 
     CPDF_Array* pRectArray = pAnnot->GetAnnotDict()->GetArrayFor("Rect");
diff --git a/fpdfsdk/fpdfeditpath.cpp b/fpdfsdk/fpdfeditpath.cpp
index d7ffd8b..f085ed3 100644
--- a/fpdfsdk/fpdfeditpath.cpp
+++ b/fpdfsdk/fpdfeditpath.cpp
@@ -35,7 +35,7 @@
 
   auto* pPathObj = reinterpret_cast<CPDF_PathObject*>(path);
   pPathObj->m_GeneralState.SetStrokeAlpha(A / 255.f);
-  FX_FLOAT rgb[3] = {R / 255.f, G / 255.f, B / 255.f};
+  float rgb[3] = {R / 255.f, G / 255.f, B / 255.f};
   pPathObj->m_ColorState.SetStrokeColor(
       CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB), rgb, 3);
   return true;
@@ -60,7 +60,7 @@
 
   auto* pPathObj = reinterpret_cast<CPDF_PathObject*>(path);
   pPathObj->m_GeneralState.SetFillAlpha(A / 255.f);
-  FX_FLOAT rgb[3] = {R / 255.f, G / 255.f, B / 255.f};
+  float rgb[3] = {R / 255.f, G / 255.f, B / 255.f};
   pPathObj->m_ColorState.SetFillColor(
       CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB), rgb, 3);
   return true;
diff --git a/fpdfsdk/fpdfformfill.cpp b/fpdfsdk/fpdfformfill.cpp
index 57ff6b6..3c866a9 100644
--- a/fpdfsdk/fpdfformfill.cpp
+++ b/fpdfsdk/fpdfformfill.cpp
@@ -156,8 +156,8 @@
   if (pPage) {
     CPDF_InterForm interform(pPage->m_pDocument);
     CPDF_FormControl* pFormCtrl = interform.GetControlAtPoint(
-        pPage, CFX_PointF(static_cast<FX_FLOAT>(page_x),
-                          static_cast<FX_FLOAT>(page_y)),
+        pPage,
+        CFX_PointF(static_cast<float>(page_x), static_cast<float>(page_y)),
         nullptr);
     if (!pFormCtrl)
       return -1;
@@ -198,8 +198,8 @@
     rcWidget.bottom -= 1.0f;
     rcWidget.top += 1.0f;
 
-    if (rcWidget.Contains(CFX_PointF(static_cast<FX_FLOAT>(page_x),
-                                     static_cast<FX_FLOAT>(page_y)))) {
+    if (rcWidget.Contains(CFX_PointF(static_cast<float>(page_x),
+                                     static_cast<float>(page_y)))) {
       return FPDF_FORMFIELD_XFA;
     }
     pXFAAnnot = pWidgetIterator->MoveToNext();
@@ -227,8 +227,7 @@
   CPDF_InterForm interform(pPage->m_pDocument);
   int z_order = -1;
   (void)interform.GetControlAtPoint(
-      pPage,
-      CFX_PointF(static_cast<FX_FLOAT>(page_x), static_cast<FX_FLOAT>(page_y)),
+      pPage, CFX_PointF(static_cast<float>(page_x), static_cast<float>(page_y)),
       &z_order);
   return z_order;
 }
@@ -318,7 +317,7 @@
   if (!pPageView)
     return false;
 
-  CFX_PointF pt((FX_FLOAT)page_x, (FX_FLOAT)page_y);
+  CFX_PointF pt((float)page_x, (float)page_y);
   return pPageView->OnLButtonUp(pt, modifier);
 }
 
@@ -343,7 +342,7 @@
   if (!pPageView)
     return false;
 
-  CFX_PointF pt((FX_FLOAT)page_x, (FX_FLOAT)page_y);
+  CFX_PointF pt((float)page_x, (float)page_y);
   return pPageView->OnRButtonUp(pt, modifier);
 }
 #endif  // PDF_ENABLE_XFA
diff --git a/fpdfsdk/fpdftext.cpp b/fpdfsdk/fpdftext.cpp
index 0432afd..cbb682d 100644
--- a/fpdfsdk/fpdftext.cpp
+++ b/fpdfsdk/fpdftext.cpp
@@ -134,9 +134,9 @@
 
   CPDF_TextPage* textpage = CPDFTextPageFromFPDFTextPage(text_page);
   return textpage->GetIndexAtPos(
-      CFX_PointF(static_cast<FX_FLOAT>(x), static_cast<FX_FLOAT>(y)),
-      CFX_SizeF(static_cast<FX_FLOAT>(xTolerance),
-                static_cast<FX_FLOAT>(yTolerance)));
+      CFX_PointF(static_cast<float>(x), static_cast<float>(y)),
+      CFX_SizeF(static_cast<float>(xTolerance),
+                static_cast<float>(yTolerance)));
 }
 
 DLLEXPORT int STDCALL FPDFText_GetText(FPDF_TEXTPAGE text_page,
@@ -201,8 +201,7 @@
     return 0;
 
   CPDF_TextPage* textpage = CPDFTextPageFromFPDFTextPage(text_page);
-  CFX_FloatRect rect((FX_FLOAT)left, (FX_FLOAT)bottom, (FX_FLOAT)right,
-                     (FX_FLOAT)top);
+  CFX_FloatRect rect((float)left, (float)bottom, (float)right, (float)top);
   CFX_WideString str = textpage->GetTextByRect(rect);
 
   if (buflen <= 0 || !buffer)
diff --git a/fpdfsdk/fpdfview.cpp b/fpdfsdk/fpdfview.cpp
index 9100017..4c3631f 100644
--- a/fpdfsdk/fpdfview.cpp
+++ b/fpdfsdk/fpdfview.cpp
@@ -891,8 +891,8 @@
   CFX_Matrix device2page;
   device2page.SetReverse(page2device);
 
-  CFX_PointF pos = device2page.Transform(CFX_PointF(
-      static_cast<FX_FLOAT>(device_x), static_cast<FX_FLOAT>(device_y)));
+  CFX_PointF pos = device2page.Transform(
+      CFX_PointF(static_cast<float>(device_x), static_cast<float>(device_y)));
 
   *page_x = pos.x;
   *page_y = pos.y;
@@ -921,7 +921,7 @@
   CFX_Matrix page2device =
       pPage->GetDisplayMatrix(start_x, start_y, size_x, size_y, rotate);
   CFX_PointF pos = page2device.Transform(
-      CFX_PointF(static_cast<FX_FLOAT>(page_x), static_cast<FX_FLOAT>(page_y)));
+      CFX_PointF(static_cast<float>(page_x), static_cast<float>(page_y)));
 
   *device_x = FXSYS_round(pos.x);
   *device_y = FXSYS_round(pos.y);
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
index 731b0cc..743b68b 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
@@ -108,8 +108,8 @@
 }
 
 bool CPDFXFA_DocEnvironment::GetPopupPos(CXFA_FFWidget* hWidget,
-                                         FX_FLOAT fMinPopup,
-                                         FX_FLOAT fMaxPopup,
+                                         float fMinPopup,
+                                         float fMaxPopup,
                                          const CFX_RectF& rtAnchor,
                                          CFX_RectF& rtPopup) {
   if (!hWidget)
@@ -185,13 +185,13 @@
     dwPos = 1;
   }
 
-  FX_FLOAT fPopupHeight;
+  float fPopupHeight;
   if (t < fMinPopup)
     fPopupHeight = fMinPopup;
   else if (t > fMaxPopup)
     fPopupHeight = fMaxPopup;
   else
-    fPopupHeight = static_cast<FX_FLOAT>(t);
+    fPopupHeight = static_cast<float>(t);
 
   switch (nRotate) {
     case 0:
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.h b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.h
index dc18d9a..4624d80 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.h
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.h
@@ -31,8 +31,8 @@
                     const CFX_RectF* pRtAnchor) override;
   // dwPos: (0:bottom 1:top)
   bool GetPopupPos(CXFA_FFWidget* hWidget,
-                   FX_FLOAT fMinPopup,
-                   FX_FLOAT fMaxPopup,
+                   float fMinPopup,
+                   float fMaxPopup,
                    const CFX_RectF& rtAnchor,
                    CFX_RectF& rtPopup) override;
   bool PopupMenu(CXFA_FFWidget* hWidget, CFX_PointF ptPopup) override;
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_page.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_page.cpp
index 8b5bb3d..d3910ae 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_page.cpp
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_page.cpp
@@ -94,7 +94,7 @@
   return true;
 }
 
-FX_FLOAT CPDFXFA_Page::GetPageWidth() const {
+float CPDFXFA_Page::GetPageWidth() const {
   if (!m_pPDFPage && !m_pXFAPageView)
     return 0.0f;
 
@@ -118,7 +118,7 @@
   return 0.0f;
 }
 
-FX_FLOAT CPDFXFA_Page::GetPageHeight() const {
+float CPDFXFA_Page::GetPageHeight() const {
   if (!m_pPDFPage && !m_pXFAPageView)
     return 0.0f;
 
@@ -158,8 +158,8 @@
   device2page.SetReverse(
       GetDisplayMatrix(start_x, start_y, size_x, size_y, rotate));
 
-  CFX_PointF pos = device2page.Transform(CFX_PointF(
-      static_cast<FX_FLOAT>(device_x), static_cast<FX_FLOAT>(device_y)));
+  CFX_PointF pos = device2page.Transform(
+      CFX_PointF(static_cast<float>(device_x), static_cast<float>(device_y)));
 
   *page_x = pos.x;
   *page_y = pos.y;
@@ -181,7 +181,7 @@
       GetDisplayMatrix(start_x, start_y, size_x, size_y, rotate);
 
   CFX_PointF pos = page2device.Transform(
-      CFX_PointF(static_cast<FX_FLOAT>(page_x), static_cast<FX_FLOAT>(page_y)));
+      CFX_PointF(static_cast<float>(page_x), static_cast<float>(page_y)));
 
   *device_x = FXSYS_round(pos.x);
   *device_y = FXSYS_round(pos.y);
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_page.h b/fpdfsdk/fpdfxfa/cpdfxfa_page.h
index 993885d..05b9238 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_page.h
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_page.h
@@ -38,8 +38,8 @@
     m_pXFAPageView = pPageView;
   }
 
-  FX_FLOAT GetPageWidth() const;
-  FX_FLOAT GetPageHeight() const;
+  float GetPageWidth() const;
+  float GetPageHeight() const;
 
   void DeviceToPage(int start_x,
                     int start_y,
diff --git a/fpdfsdk/fxedit/fxet_edit.cpp b/fpdfsdk/fxedit/fxet_edit.cpp
index 1acc577..0a5c3d9 100644
--- a/fpdfsdk/fxedit/fxet_edit.cpp
+++ b/fpdfsdk/fxedit/fxet_edit.cpp
@@ -43,7 +43,7 @@
 
 CFX_ByteString GetFontSetString(IPVT_FontMap* pFontMap,
                                 int32_t nFontIndex,
-                                FX_FLOAT fFontSize) {
+                                float fFontSize) {
   if (!pFontMap)
     return CFX_ByteString();
 
@@ -59,7 +59,7 @@
 void DrawTextString(CFX_RenderDevice* pDevice,
                     const CFX_PointF& pt,
                     CPDF_Font* pFont,
-                    FX_FLOAT fFontSize,
+                    float fFontSize,
                     CFX_Matrix* pUser2Device,
                     const CFX_ByteString& str,
                     FX_ARGB crTextFill,
@@ -673,7 +673,7 @@
       sAppStream << nHorzScale << " Tz\n";
     }
 
-    FX_FLOAT fCharSpace = pEdit->GetCharSpace();
+    float fCharSpace = pEdit->GetCharSpace();
     if (!IsFloatZero(fCharSpace)) {
       sAppStream << fCharSpace << " Tc\n";
     }
@@ -726,7 +726,7 @@
   const bool bContinuous =
       pEdit->GetCharArray() == 0 && pEdit->GetCharSpace() <= 0.0f;
   uint16_t SubWord = pEdit->GetPasswordChar();
-  FX_FLOAT fFontSize = pEdit->GetFontSize();
+  float fFontSize = pEdit->GetFontSize();
   CPVT_WordRange wrSelect = pEdit->GetSelectWordRange();
   int32_t nHorzScale = pEdit->GetHorzScale();
 
@@ -921,7 +921,7 @@
   Paint();
 }
 
-void CFX_Edit::SetCharSpace(FX_FLOAT fCharSpace) {
+void CFX_Edit::SetCharSpace(float fCharSpace) {
   m_pVT->SetCharSpace(fCharSpace);
   Paint();
 }
@@ -944,7 +944,7 @@
     Paint();
 }
 
-void CFX_Edit::SetFontSize(FX_FLOAT fFontSize) {
+void CFX_Edit::SetFontSize(float fFontSize) {
   m_pVT->SetFontSize(fFontSize);
   Paint();
 }
@@ -1139,7 +1139,7 @@
   return InsertText(sText, charset, true, true);
 }
 
-FX_FLOAT CFX_Edit::GetFontSize() const {
+float CFX_Edit::GetFontSize() const {
   return m_pVT->GetFontSize();
 }
 
@@ -1159,7 +1159,7 @@
   return m_pVT->GetHorzScale();
 }
 
-FX_FLOAT CFX_Edit::GetCharSpace() const {
+float CFX_Edit::GetCharSpace() const {
   return m_pVT->GetCharSpace();
 }
 
@@ -1269,7 +1269,7 @@
   CFX_FloatRect rcContent = m_pVT->GetContentRect();
   CFX_FloatRect rcPlate = m_pVT->GetPlateRect();
 
-  FX_FLOAT fPadding = 0.0f;
+  float fPadding = 0.0f;
 
   switch (m_nAlignment) {
     case 0:
@@ -1291,7 +1291,7 @@
   CFX_FloatRect rcContent = m_pVT->GetContentRect();
   CFX_FloatRect rcPlate = m_pVT->GetPlateRect();
 
-  FX_FLOAT fPadding = 0.0f;
+  float fPadding = 0.0f;
 
   switch (m_nAlignment) {
     case 0:
@@ -1332,7 +1332,7 @@
   }
 }
 
-void CFX_Edit::SetScrollPosX(FX_FLOAT fx) {
+void CFX_Edit::SetScrollPosX(float fx) {
   if (!m_bEnableScroll)
     return;
 
@@ -1344,7 +1344,7 @@
   }
 }
 
-void CFX_Edit::SetScrollPosY(FX_FLOAT fy) {
+void CFX_Edit::SetScrollPosY(float fy) {
   if (!m_bEnableScroll)
     return;
 
diff --git a/fpdfsdk/fxedit/fxet_edit.h b/fpdfsdk/fxedit/fxet_edit.h
index ab83af2..4fcb556 100644
--- a/fpdfsdk/fxedit/fxet_edit.h
+++ b/fpdfsdk/fxedit/fxet_edit.h
@@ -357,12 +357,12 @@
   // Set the maximum number of words in the text.
   void SetLimitChar(int32_t nLimitChar);
   void SetCharArray(int32_t nCharArray);
-  void SetCharSpace(FX_FLOAT fCharSpace);
+  void SetCharSpace(float fCharSpace);
   void SetMultiLine(bool bMultiLine, bool bPaint);
   void SetAutoReturn(bool bAuto, bool bPaint);
   void SetAutoFontSize(bool bAuto, bool bPaint);
   void SetAutoScroll(bool bAuto, bool bPaint);
-  void SetFontSize(FX_FLOAT fFontSize);
+  void SetFontSize(float fFontSize);
   void SetTextOverflow(bool bAllowed, bool bPaint);
   void OnMouseDown(const CFX_PointF& point, bool bShift, bool bCtrl);
   void OnMouseMove(const CFX_PointF& point, bool bShift, bool bCtrl);
@@ -388,14 +388,14 @@
   CPVT_WordPlace GetCaretWordPlace() const;
   CFX_WideString GetSelText() const;
   CFX_WideString GetText() const;
-  FX_FLOAT GetFontSize() const;
+  float GetFontSize() const;
   uint16_t GetPasswordChar() const;
   CFX_PointF GetScrollPos() const;
   int32_t GetCharArray() const;
   CFX_FloatRect GetContentRect() const;
   CFX_WideString GetRangeText(const CPVT_WordRange& range) const;
   int32_t GetHorzScale() const;
-  FX_FLOAT GetCharSpace() const;
+  float GetCharSpace() const;
   int32_t GetTotalWords() const;
   void SetSel(int32_t nStartChar, int32_t nEndChar);
   void GetSel(int32_t& nStartChar, int32_t& nEndChar) const;
@@ -440,8 +440,8 @@
   void RearrangePart(const CPVT_WordRange& range);
   void ScrollToCaret();
   void SetScrollInfo();
-  void SetScrollPosX(FX_FLOAT fx);
-  void SetScrollPosY(FX_FLOAT fy);
+  void SetScrollPosX(float fx);
+  void SetScrollPosY(float fy);
   void SetScrollLimit();
   void SetContentChanged();
 
diff --git a/fpdfsdk/fxedit/fxet_list.cpp b/fpdfsdk/fxedit/fxet_list.cpp
index 3782cf0..d795035 100644
--- a/fpdfsdk/fxedit/fxet_list.cpp
+++ b/fpdfsdk/fxedit/fxet_list.cpp
@@ -53,11 +53,11 @@
   m_pEdit->SetText(text);
 }
 
-void CFX_ListItem::SetFontSize(FX_FLOAT fFontSize) {
+void CFX_ListItem::SetFontSize(float fFontSize) {
   m_pEdit->SetFontSize(fFontSize);
 }
 
-FX_FLOAT CFX_ListItem::GetItemHeight() const {
+float CFX_ListItem::GetItemHeight() const {
   return m_pEdit->GetContentRect().Height();
 }
 
@@ -542,7 +542,7 @@
   SetScrollPosY(point.y);
 }
 
-void CFX_ListCtrl::SetScrollPosY(FX_FLOAT fy) {
+void CFX_ListCtrl::SetScrollPosY(float fy) {
   if (!IsFloatEqual(m_ptScrollPos.y, fy)) {
     CFX_FloatRect rcPlate = GetPlateRect();
     CFX_FloatRect rcContent = GetContentRectInternal();
@@ -579,14 +579,14 @@
 }
 
 void CFX_ListCtrl::ReArrange(int32_t nItemIndex) {
-  FX_FLOAT fPosY = 0.0f;
+  float fPosY = 0.0f;
 
   if (CFX_ListItem* pPrevItem = m_aListItems.GetAt(nItemIndex - 1))
     fPosY = pPrevItem->GetRect().bottom;
 
   for (int32_t i = nItemIndex, sz = m_aListItems.GetSize(); i < sz; i++) {
     if (CFX_ListItem* pListItem = m_aListItems.GetAt(i)) {
-      FX_FLOAT fListItemHeight = pListItem->GetItemHeight();
+      float fListItemHeight = pListItem->GetItemHeight();
       pListItem->SetRect(CLST_Rect(0.0f, fPosY, 0.0f, fPosY + fListItemHeight));
       fPosY += fListItemHeight;
     }
@@ -668,7 +668,7 @@
   m_pFontMap = pFontMap;
 }
 
-void CFX_ListCtrl::SetFontSize(FX_FLOAT fFontSize) {
+void CFX_ListCtrl::SetFontSize(float fFontSize) {
   m_fFontSize = fFontSize;
 }
 
@@ -696,11 +696,11 @@
   return CFX_ListContainer::GetPlateRect();
 }
 
-FX_FLOAT CFX_ListCtrl::GetFontSize() const {
+float CFX_ListCtrl::GetFontSize() const {
   return m_fFontSize;
 }
 
-FX_FLOAT CFX_ListCtrl::GetFirstHeight() const {
+float CFX_ListCtrl::GetFirstHeight() const {
   if (CFX_ListItem* pListItem = m_aListItems.GetAt(0)) {
     return pListItem->GetItemHeight();
   }
diff --git a/fpdfsdk/fxedit/fxet_list.h b/fpdfsdk/fxedit/fxet_list.h
index 9d07187..00e03d8 100644
--- a/fpdfsdk/fxedit/fxet_list.h
+++ b/fpdfsdk/fxedit/fxet_list.h
@@ -20,10 +20,10 @@
  public:
   CLST_Rect() { left = top = right = bottom = 0.0f; }
 
-  CLST_Rect(FX_FLOAT other_left,
-            FX_FLOAT other_top,
-            FX_FLOAT other_right,
-            FX_FLOAT other_bottom) {
+  CLST_Rect(float other_left,
+            float other_top,
+            float other_right,
+            float other_bottom) {
     left = other_left;
     top = other_top;
     right = other_right;
@@ -56,9 +56,9 @@
 
   bool operator!=(const CLST_Rect& rect) const { return !(*this == rect); }
 
-  FX_FLOAT Width() const { return right - left; }
+  float Width() const { return right - left; }
 
-  FX_FLOAT Height() const {
+  float Height() const {
     if (top > bottom)
       return top - bottom;
     return bottom - top;
@@ -108,12 +108,12 @@
   void SetRect(const CLST_Rect& rect);
   void SetSelect(bool bSelected);
   void SetText(const CFX_WideString& text);
-  void SetFontSize(FX_FLOAT fFontSize);
+  void SetFontSize(float fFontSize);
   CFX_WideString GetText() const;
 
   CLST_Rect GetRect() const;
   bool IsSelected() const;
-  FX_FLOAT GetItemHeight() const;
+  float GetItemHeight() const;
   uint16_t GetFirstChar() const;
 
  private:
@@ -252,13 +252,13 @@
   CFX_WideString GetText() const;
 
   void SetFontMap(IPVT_FontMap* pFontMap);
-  void SetFontSize(FX_FLOAT fFontSize);
+  void SetFontSize(float fFontSize);
   CFX_FloatRect GetPlateRect() const;
-  FX_FLOAT GetFontSize() const;
+  float GetFontSize() const;
   CFX_Edit* GetItemEdit(int32_t nIndex) const;
   int32_t GetCount() const;
   bool IsItemSelected(int32_t nIndex) const;
-  FX_FLOAT GetFirstHeight() const;
+  float GetFirstHeight() const;
   void SetMultipleSel(bool bMultiple);
   bool IsMultipleSel() const;
   bool IsValid(int32_t nItemIndex) const;
@@ -280,7 +280,7 @@
   void SelectItems();
   bool IsItemVisible(int32_t nItemIndex) const;
   void SetScrollInfo();
-  void SetScrollPosY(FX_FLOAT fy);
+  void SetScrollPosY(float fy);
   void AddItem(const CFX_WideString& str);
   CFX_WideString GetItemText(int32_t nIndex) const;
   void SetItemSelect(int32_t nItemIndex, bool bSelected);
@@ -296,7 +296,7 @@
   bool m_bCtrlSel;           // for multiple
   int32_t m_nCaretIndex;     // for multiple
   CLST_ArrayTemplate<CFX_ListItem*> m_aListItems;
-  FX_FLOAT m_fFontSize;
+  float m_fFontSize;
   IPVT_FontMap* m_pFontMap;
   bool m_bMultiple;
 };
diff --git a/fpdfsdk/javascript/Document.cpp b/fpdfsdk/javascript/Document.cpp
index a45b8b9..45c22b1 100644
--- a/fpdfsdk/javascript/Document.cpp
+++ b/fpdfsdk/javascript/Document.cpp
@@ -1468,7 +1468,7 @@
 
   for (int i = 0, sz = pTextObj->CountChars(); i < sz; i++) {
     uint32_t charcode = CPDF_Font::kInvalidCharCode;
-    FX_FLOAT kerning;
+    float kerning;
 
     pTextObj->GetCharInfo(i, &charcode, &kerning);
     CFX_WideString swUnicode = pFont->UnicodeFromCharCode(charcode);
@@ -1501,7 +1501,7 @@
 
   for (int i = 0, sz = pTextObj->CountChars(); i < sz; i++) {
     uint32_t charcode = CPDF_Font::kInvalidCharCode;
-    FX_FLOAT kerning;
+    float kerning;
 
     pTextObj->GetCharInfo(i, &charcode, &kerning);
     CFX_WideString swUnicode = pFont->UnicodeFromCharCode(charcode);
diff --git a/fpdfsdk/javascript/Field.cpp b/fpdfsdk/javascript/Field.cpp
index 61a2538..12c3508 100644
--- a/fpdfsdk/javascript/Field.cpp
+++ b/fpdfsdk/javascript/Field.cpp
@@ -575,7 +575,7 @@
 
     CPDF_IconFit IconFit = pFormControl->GetIconFit();
 
-    FX_FLOAT fLeft, fBottom;
+    float fLeft, fBottom;
     IconFit.GetIconPosition(fLeft, fBottom);
 
     vp << (int32_t)fLeft;
@@ -624,7 +624,7 @@
 
     CPDF_IconFit IconFit = pFormControl->GetIconFit();
 
-    FX_FLOAT fLeft, fBottom;
+    float fLeft, fBottom;
     IconFit.GetIconPosition(fLeft, fBottom);
 
     vp << (int32_t)fBottom;
@@ -2003,11 +2003,11 @@
     rcArray.GetElement(pRuntime, 2, Lower_Rightx);
     rcArray.GetElement(pRuntime, 3, Lower_Righty);
 
-    FX_FLOAT pArray[4] = {0.0f, 0.0f, 0.0f, 0.0f};
-    pArray[0] = static_cast<FX_FLOAT>(Upper_Leftx.ToInt(pRuntime));
-    pArray[1] = static_cast<FX_FLOAT>(Lower_Righty.ToInt(pRuntime));
-    pArray[2] = static_cast<FX_FLOAT>(Lower_Rightx.ToInt(pRuntime));
-    pArray[3] = static_cast<FX_FLOAT>(Upper_Lefty.ToInt(pRuntime));
+    float pArray[4] = {0.0f, 0.0f, 0.0f, 0.0f};
+    pArray[0] = static_cast<float>(Upper_Leftx.ToInt(pRuntime));
+    pArray[1] = static_cast<float>(Lower_Righty.ToInt(pRuntime));
+    pArray[2] = static_cast<float>(Lower_Rightx.ToInt(pRuntime));
+    pArray[3] = static_cast<float>(Upper_Lefty.ToInt(pRuntime));
 
     CFX_FloatRect crRect(pArray);
     if (m_bDelay) {
@@ -2485,7 +2485,7 @@
   CPDF_DefaultAppearance FieldAppearance = pFormControl->GetDefaultAppearance();
 
   CFX_ByteString csFontNameTag;
-  FX_FLOAT fFontSize;
+  float fFontSize;
   FieldAppearance.GetFont(csFontNameTag, fFontSize);
   vp << (int)fFontSize;
   return true;
diff --git a/fpdfsdk/javascript/color.cpp b/fpdfsdk/javascript/color.cpp
index b5ccbad..376eefa 100644
--- a/fpdfsdk/javascript/color.cpp
+++ b/fpdfsdk/javascript/color.cpp
@@ -121,13 +121,12 @@
   if (sSpace == "T") {
     *color = CPWL_Color(COLORTYPE_TRANSPARENT);
   } else if (sSpace == "G") {
-    *color = CPWL_Color(COLORTYPE_GRAY, (FX_FLOAT)d1);
+    *color = CPWL_Color(COLORTYPE_GRAY, (float)d1);
   } else if (sSpace == "RGB") {
-    *color =
-        CPWL_Color(COLORTYPE_RGB, (FX_FLOAT)d1, (FX_FLOAT)d2, (FX_FLOAT)d3);
+    *color = CPWL_Color(COLORTYPE_RGB, (float)d1, (float)d2, (float)d3);
   } else if (sSpace == "CMYK") {
-    *color = CPWL_Color(COLORTYPE_CMYK, (FX_FLOAT)d1, (FX_FLOAT)d2,
-                        (FX_FLOAT)d3, (FX_FLOAT)d4);
+    *color =
+        CPWL_Color(COLORTYPE_CMYK, (float)d1, (float)d2, (float)d3, (float)d4);
   }
 }
 
diff --git a/fpdfsdk/pdfwindow/PWL_Caret.cpp b/fpdfsdk/pdfwindow/PWL_Caret.cpp
index 3360bbf..3658fbc 100644
--- a/fpdfsdk/pdfwindow/PWL_Caret.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Caret.cpp
@@ -35,9 +35,9 @@
     CFX_FloatRect rcClip = GetClipRect();
     CFX_PathData path;
 
-    FX_FLOAT fCaretX = rcRect.left + m_fWidth * 0.5f;
-    FX_FLOAT fCaretTop = rcRect.top;
-    FX_FLOAT fCaretBottom = rcRect.bottom;
+    float fCaretX = rcRect.left + m_fWidth * 0.5f;
+    float fCaretTop = rcRect.top;
+    float fCaretBottom = rcRect.bottom;
     if (!rcClip.IsEmpty()) {
       rcRect.Intersect(rcClip);
       if (rcRect.IsEmpty())
diff --git a/fpdfsdk/pdfwindow/PWL_Caret.h b/fpdfsdk/pdfwindow/PWL_Caret.h
index 60ebbdc..7c041f4 100644
--- a/fpdfsdk/pdfwindow/PWL_Caret.h
+++ b/fpdfsdk/pdfwindow/PWL_Caret.h
@@ -45,7 +45,7 @@
   bool m_bFlash;
   CFX_PointF m_ptHead;
   CFX_PointF m_ptFoot;
-  FX_FLOAT m_fWidth;
+  float m_fWidth;
   int32_t m_nDelay;
   CFX_FloatRect m_rcInvalid;
 };
diff --git a/fpdfsdk/pdfwindow/PWL_ComboBox.cpp b/fpdfsdk/pdfwindow/PWL_ComboBox.cpp
index bc6909a..5adf456 100644
--- a/fpdfsdk/pdfwindow/PWL_ComboBox.cpp
+++ b/fpdfsdk/pdfwindow/PWL_ComboBox.cpp
@@ -339,8 +339,8 @@
     CFX_FloatRect rcEdit = rcClient;
     CFX_FloatRect rcList = CPWL_Wnd::GetWindowRect();
 
-    FX_FLOAT fOldWindowHeight = m_rcOldWindow.Height();
-    FX_FLOAT fOldClientHeight = fOldWindowHeight - GetBorderWidth() * 2;
+    float fOldWindowHeight = m_rcOldWindow.Height();
+    float fOldClientHeight = fOldWindowHeight - GetBorderWidth() * 2;
 
     switch (m_nPopupWhere) {
       case 0:
@@ -440,7 +440,7 @@
     return;
   if (bPopup == m_bPopup)
     return;
-  FX_FLOAT fListHeight = m_pList->GetContentRect().Height();
+  float fListHeight = m_pList->GetContentRect().Height();
   if (!IsFloatBigger(fListHeight, 0.0f))
     return;
 
@@ -453,12 +453,12 @@
         return;
 #endif  // PDF_ENABLE_XFA
       int32_t nWhere = 0;
-      FX_FLOAT fPopupRet = 0.0f;
-      FX_FLOAT fPopupMin = 0.0f;
+      float fPopupRet = 0.0f;
+      float fPopupMin = 0.0f;
       if (m_pList->GetCount() > 3)
         fPopupMin =
             m_pList->GetFirstHeight() * 3 + m_pList->GetBorderWidth() * 2;
-      FX_FLOAT fPopupMax = fListHeight + m_pList->GetBorderWidth() * 2;
+      float fPopupMax = fListHeight + m_pList->GetBorderWidth() * 2;
       m_pFillerNotify->QueryWherePopup(GetAttachedData(), fPopupMin, fPopupMax,
                                        nWhere, fPopupRet);
 
diff --git a/fpdfsdk/pdfwindow/PWL_Edit.cpp b/fpdfsdk/pdfwindow/PWL_Edit.cpp
index b77aad9..f84c38e 100644
--- a/fpdfsdk/pdfwindow/PWL_Edit.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Edit.cpp
@@ -101,7 +101,7 @@
 
 CFX_FloatRect CPWL_Edit::GetClientRect() const {
   CFX_FloatRect rcClient = CPWL_Utils::DeflateRect(
-      GetWindowRect(), (FX_FLOAT)(GetBorderWidth() + GetInnerBorderWidth()));
+      GetWindowRect(), (float)(GetBorderWidth() + GetInnerBorderWidth()));
 
   if (CPWL_ScrollBar* pVSB = GetVScrollBar()) {
     if (pVSB->IsVisible()) {
@@ -329,7 +329,7 @@
     switch (GetBorderStyle()) {
       case BorderStyle::SOLID: {
         CFX_GraphStateData gsd;
-        gsd.m_LineWidth = (FX_FLOAT)GetBorderWidth();
+        gsd.m_LineWidth = (float)GetBorderWidth();
 
         CFX_PathData path;
 
@@ -355,12 +355,12 @@
       }
       case BorderStyle::DASH: {
         CFX_GraphStateData gsd;
-        gsd.m_LineWidth = (FX_FLOAT)GetBorderWidth();
+        gsd.m_LineWidth = (float)GetBorderWidth();
 
         gsd.SetDashCount(2);
-        gsd.m_DashArray[0] = (FX_FLOAT)GetBorderDash().nDash;
-        gsd.m_DashArray[1] = (FX_FLOAT)GetBorderDash().nGap;
-        gsd.m_DashPhase = (FX_FLOAT)GetBorderDash().nPhase;
+        gsd.m_DashArray[0] = (float)GetBorderDash().nDash;
+        gsd.m_DashArray[1] = (float)GetBorderDash().nGap;
+        gsd.m_DashPhase = (float)GetBorderDash().nPhase;
 
         CFX_PathData path;
         for (int32_t i = 0; i < nCharArray - 1; i++) {
@@ -463,7 +463,7 @@
   m_bFocus = false;
 }
 
-void CPWL_Edit::SetCharSpace(FX_FLOAT fCharSpace) {
+void CPWL_Edit::SetCharSpace(float fCharSpace) {
   m_pEdit->SetCharSpace(fCharSpace);
 }
 
@@ -527,16 +527,16 @@
   return m_pEdit->IsTextFull();
 }
 
-FX_FLOAT CPWL_Edit::GetCharArrayAutoFontSize(CPDF_Font* pFont,
-                                             const CFX_FloatRect& rcPlate,
-                                             int32_t nCharArray) {
+float CPWL_Edit::GetCharArrayAutoFontSize(CPDF_Font* pFont,
+                                          const CFX_FloatRect& rcPlate,
+                                          int32_t nCharArray) {
   if (pFont && !pFont->IsStandardFont()) {
     FX_RECT rcBBox;
     pFont->GetFontBBox(rcBBox);
 
     CFX_FloatRect rcCell = rcPlate;
-    FX_FLOAT xdiv = rcCell.Width() / nCharArray * 1000.0f / rcBBox.Width();
-    FX_FLOAT ydiv = -rcCell.Height() * 1000.0f / rcBBox.Height();
+    float xdiv = rcCell.Width() / nCharArray * 1000.0f / rcBBox.Width();
+    float ydiv = -rcCell.Height() * 1000.0f / rcBBox.Height();
 
     return xdiv < ydiv ? xdiv : ydiv;
   }
@@ -551,8 +551,8 @@
 
     if (HasFlag(PWS_AUTOFONTSIZE)) {
       if (IPVT_FontMap* pFontMap = GetFontMap()) {
-        FX_FLOAT fFontSize = GetCharArrayAutoFontSize(
-            pFontMap->GetPDFFont(0), GetClientRect(), nCharArray);
+        float fFontSize = GetCharArrayAutoFontSize(pFontMap->GetPDFFont(0),
+                                                   GetClientRect(), nCharArray);
         if (fFontSize > 0.0f) {
           m_pEdit->SetAutoFontSize(false, true);
           m_pEdit->SetFontSize(fFontSize);
diff --git a/fpdfsdk/pdfwindow/PWL_Edit.h b/fpdfsdk/pdfwindow/PWL_Edit.h
index b6d0130..5e1a366 100644
--- a/fpdfsdk/pdfwindow/PWL_Edit.h
+++ b/fpdfsdk/pdfwindow/PWL_Edit.h
@@ -21,12 +21,11 @@
 class IPWL_Filler_Notify {
  public:
   virtual ~IPWL_Filler_Notify() {}
-  virtual void QueryWherePopup(
-      void* pPrivateData,
-      FX_FLOAT fPopupMin,
-      FX_FLOAT fPopupMax,
-      int32_t& nRet,
-      FX_FLOAT& fPopupRet) = 0;  // nRet: (0:bottom 1:top)
+  virtual void QueryWherePopup(void* pPrivateData,
+                               float fPopupMin,
+                               float fPopupMax,
+                               int32_t& nRet,
+                               float& fPopupRet) = 0;  // nRet: (0:bottom 1:top)
   virtual void OnBeforeKeyStroke(void* pPrivateData,
                                  CFX_WideString& strChange,
                                  const CFX_WideString& strChangeEx,
@@ -78,7 +77,7 @@
   void SetCharArray(int32_t nCharArray);
   void SetLimitChar(int32_t nLimitChar);
 
-  void SetCharSpace(FX_FLOAT fCharSpace);
+  void SetCharSpace(float fCharSpace);
 
   bool CanSelectAll() const;
   bool CanClear() const;
@@ -96,9 +95,9 @@
 
   bool IsTextFull() const;
 
-  static FX_FLOAT GetCharArrayAutoFontSize(CPDF_Font* pFont,
-                                           const CFX_FloatRect& rcPlate,
-                                           int32_t nCharArray);
+  static float GetCharArrayAutoFontSize(CPDF_Font* pFont,
+                                        const CFX_FloatRect& rcPlate,
+                                        int32_t nCharArray);
 
   void SetFillerNotify(IPWL_Filler_Notify* pNotify) {
     m_pFillerNotify = pNotify;
@@ -123,7 +122,7 @@
   bool IsVScrollBarVisible() const;
   void SetParamByFlag();
 
-  FX_FLOAT GetCharArrayAutoFontSize(int32_t nCharArray);
+  float GetCharArrayAutoFontSize(int32_t nCharArray);
   CFX_PointF GetWordRightBottomPoint(const CPVT_WordPlace& wpWord);
 
   CPVT_WordRange CombineWordRange(const CPVT_WordRange& wr1,
diff --git a/fpdfsdk/pdfwindow/PWL_EditCtrl.cpp b/fpdfsdk/pdfwindow/PWL_EditCtrl.cpp
index 4921ab7..e7371fd 100644
--- a/fpdfsdk/pdfwindow/PWL_EditCtrl.cpp
+++ b/fpdfsdk/pdfwindow/PWL_EditCtrl.cpp
@@ -84,7 +84,7 @@
       }
       break;
     case PNM_SCROLLWINDOW: {
-      FX_FLOAT fPos = *(FX_FLOAT*)lParam;
+      float fPos = *(float*)lParam;
       switch (wParam) {
         case SBT_VSCROLL:
           m_pEdit->SetScrollPos(CFX_PointF(m_pEdit->GetScrollPos().x, fPos));
@@ -121,11 +121,11 @@
   m_pEditCaret->Create(ecp);
 }
 
-void CPWL_EditCtrl::SetFontSize(FX_FLOAT fFontSize) {
+void CPWL_EditCtrl::SetFontSize(float fFontSize) {
   m_pEdit->SetFontSize(fFontSize);
 }
 
-FX_FLOAT CPWL_EditCtrl::GetFontSize() const {
+float CPWL_EditCtrl::GetFontSize() const {
   return m_pEdit->GetFontSize();
 }
 
@@ -427,8 +427,8 @@
   return nullptr;
 }
 
-FX_FLOAT CPWL_EditCtrl::GetCaretFontSize() const {
-  FX_FLOAT fFontSize = GetFontSize();
+float CPWL_EditCtrl::GetCaretFontSize() const {
+  float fFontSize = GetFontSize();
 
   CFX_Edit_Iterator* pIterator = m_pEdit->GetIterator();
   pIterator->SetAt(m_pEdit->GetCaret());
@@ -500,12 +500,12 @@
     m_pEdit->Undo();
 }
 
-void CPWL_EditCtrl::IOnSetScrollInfoY(FX_FLOAT fPlateMin,
-                                      FX_FLOAT fPlateMax,
-                                      FX_FLOAT fContentMin,
-                                      FX_FLOAT fContentMax,
-                                      FX_FLOAT fSmallStep,
-                                      FX_FLOAT fBigStep) {
+void CPWL_EditCtrl::IOnSetScrollInfoY(float fPlateMin,
+                                      float fPlateMax,
+                                      float fContentMin,
+                                      float fContentMax,
+                                      float fSmallStep,
+                                      float fBigStep) {
   PWL_SCROLL_INFO Info;
 
   Info.fPlateWidth = fPlateMax - fPlateMin;
@@ -524,7 +524,7 @@
   }
 }
 
-void CPWL_EditCtrl::IOnSetScrollPosY(FX_FLOAT fy) {
+void CPWL_EditCtrl::IOnSetScrollPosY(float fy) {
   OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL, (intptr_t)&fy);
 }
 
diff --git a/fpdfsdk/pdfwindow/PWL_EditCtrl.h b/fpdfsdk/pdfwindow/PWL_EditCtrl.h
index 498570b..6977673 100644
--- a/fpdfsdk/pdfwindow/PWL_EditCtrl.h
+++ b/fpdfsdk/pdfwindow/PWL_EditCtrl.h
@@ -62,7 +62,7 @@
   int32_t GetCodePage() const { return m_nCodePage; }
 
   CPDF_Font* GetCaretFont() const;
-  FX_FLOAT GetCaretFontSize() const;
+  float GetCaretFontSize() const;
 
   bool CanUndo() const;
   bool CanRedo() const;
@@ -85,17 +85,17 @@
                 intptr_t lParam = 0) override;
   void CreateChildWnd(const PWL_CREATEPARAM& cp) override;
   void RePosChildWnd() override;
-  void SetFontSize(FX_FLOAT fFontSize) override;
-  FX_FLOAT GetFontSize() const override;
+  void SetFontSize(float fFontSize) override;
+  float GetFontSize() const override;
   void SetCursor() override;
 
-  void IOnSetScrollInfoY(FX_FLOAT fPlateMin,
-                         FX_FLOAT fPlateMax,
-                         FX_FLOAT fContentMin,
-                         FX_FLOAT fContentMax,
-                         FX_FLOAT fSmallStep,
-                         FX_FLOAT fBigStep);
-  void IOnSetScrollPosY(FX_FLOAT fy);
+  void IOnSetScrollInfoY(float fPlateMin,
+                         float fPlateMax,
+                         float fContentMin,
+                         float fContentMax,
+                         float fSmallStep,
+                         float fBigStep);
+  void IOnSetScrollPosY(float fy);
   void IOnSetCaret(bool bVisible,
                    const CFX_PointF& ptHead,
                    const CFX_PointF& ptFoot,
diff --git a/fpdfsdk/pdfwindow/PWL_Icon.cpp b/fpdfsdk/pdfwindow/PWL_Icon.cpp
index 4ce6329..3ae7244 100644
--- a/fpdfsdk/pdfwindow/PWL_Icon.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Icon.cpp
@@ -25,12 +25,12 @@
   CFX_Matrix mt;
   mt.SetReverse(GetImageMatrix());
 
-  FX_FLOAT fHScale = 1.0f;
-  FX_FLOAT fVScale = 1.0f;
+  float fHScale = 1.0f;
+  float fVScale = 1.0f;
   GetScale(fHScale, fVScale);
 
-  FX_FLOAT fx = 0.0f;
-  FX_FLOAT fy = 0.0f;
+  float fx = 0.0f;
+  float fy = 0.0f;
   GetImageOffset(fx, fy);
 
   if (m_pPDFStream && sAlias.GetLength() > 0) {
@@ -59,7 +59,7 @@
   return m_pPDFStream;
 }
 
-void CPWL_Image::GetImageSize(FX_FLOAT& fWidth, FX_FLOAT& fHeight) {
+void CPWL_Image::GetImageSize(float& fWidth, float& fHeight) {
   fWidth = 0.0f;
   fHeight = 0.0f;
 
@@ -100,12 +100,12 @@
   m_sImageAlias = sImageAlias;
 }
 
-void CPWL_Image::GetScale(FX_FLOAT& fHScale, FX_FLOAT& fVScale) {
+void CPWL_Image::GetScale(float& fHScale, float& fVScale) {
   fHScale = 1.0f;
   fVScale = 1.0f;
 }
 
-void CPWL_Image::GetImageOffset(FX_FLOAT& x, FX_FLOAT& y) {
+void CPWL_Image::GetImageOffset(float& x, float& y) {
   x = 0.0f;
   y = 0.0f;
 }
@@ -132,7 +132,7 @@
   return false;
 }
 
-void CPWL_Icon::GetIconPosition(FX_FLOAT& fLeft, FX_FLOAT& fBottom) {
+void CPWL_Icon::GetIconPosition(float& fLeft, float& fBottom) {
   if (m_pIconFit) {
     fLeft = 0.0f;
     fBottom = 0.0f;
@@ -152,13 +152,13 @@
   }
 }
 
-void CPWL_Icon::GetScale(FX_FLOAT& fHScale, FX_FLOAT& fVScale) {
+void CPWL_Icon::GetScale(float& fHScale, float& fVScale) {
   fHScale = 1.0f;
   fVScale = 1.0f;
 
   if (m_pPDFStream) {
-    FX_FLOAT fImageWidth, fImageHeight;
-    FX_FLOAT fPlateWidth, fPlateHeight;
+    float fImageWidth, fImageHeight;
+    float fPlateWidth, fPlateHeight;
 
     CFX_FloatRect rcPlate = GetClientRect();
     fPlateWidth = rcPlate.right - rcPlate.left;
@@ -190,7 +190,7 @@
         break;
     }
 
-    FX_FLOAT fMinScale;
+    float fMinScale;
     if (IsProportionalScale()) {
       fMinScale = std::min(fHScale, fVScale);
       fHScale = fMinScale;
@@ -199,23 +199,23 @@
   }
 }
 
-void CPWL_Icon::GetImageOffset(FX_FLOAT& x, FX_FLOAT& y) {
-  FX_FLOAT fLeft, fBottom;
+void CPWL_Icon::GetImageOffset(float& x, float& y) {
+  float fLeft, fBottom;
 
   GetIconPosition(fLeft, fBottom);
   x = 0.0f;
   y = 0.0f;
 
-  FX_FLOAT fImageWidth, fImageHeight;
+  float fImageWidth, fImageHeight;
   GetImageSize(fImageWidth, fImageHeight);
 
-  FX_FLOAT fHScale, fVScale;
+  float fHScale, fVScale;
   GetScale(fHScale, fVScale);
 
-  FX_FLOAT fImageFactWidth = fImageWidth * fHScale;
-  FX_FLOAT fImageFactHeight = fImageHeight * fVScale;
+  float fImageFactWidth = fImageWidth * fHScale;
+  float fImageFactHeight = fImageHeight * fVScale;
 
-  FX_FLOAT fPlateWidth, fPlateHeight;
+  float fPlateWidth, fPlateHeight;
   CFX_FloatRect rcPlate = GetClientRect();
   fPlateWidth = rcPlate.right - rcPlate.left;
   fPlateHeight = rcPlate.top - rcPlate.bottom;
diff --git a/fpdfsdk/pdfwindow/PWL_Icon.h b/fpdfsdk/pdfwindow/PWL_Icon.h
index bdcae9f..49ac1f3 100644
--- a/fpdfsdk/pdfwindow/PWL_Icon.h
+++ b/fpdfsdk/pdfwindow/PWL_Icon.h
@@ -17,13 +17,13 @@
 
   virtual CFX_ByteString GetImageAppStream();
 
-  virtual void GetScale(FX_FLOAT& fHScale, FX_FLOAT& fVScale);
-  virtual void GetImageOffset(FX_FLOAT& x, FX_FLOAT& y);
+  virtual void GetScale(float& fHScale, float& fVScale);
+  virtual void GetImageOffset(float& x, float& y);
   virtual CPDF_Stream* GetPDFStream();
 
  public:
   void SetPDFStream(CPDF_Stream* pStream);
-  void GetImageSize(FX_FLOAT& fWidth, FX_FLOAT& fHeight);
+  void GetImageSize(float& fWidth, float& fHeight);
   CFX_Matrix GetImageMatrix();
   CFX_ByteString GetImageAlias();
   void SetImageAlias(const char* sImageAlias);
@@ -41,12 +41,12 @@
   virtual CPDF_IconFit* GetIconFit();
 
   // CPWL_Image
-  void GetScale(FX_FLOAT& fHScale, FX_FLOAT& fVScale) override;
-  void GetImageOffset(FX_FLOAT& x, FX_FLOAT& y) override;
+  void GetScale(float& fHScale, float& fVScale) override;
+  void GetImageOffset(float& x, float& y) override;
 
   int32_t GetScaleMethod();
   bool IsProportionalScale();
-  void GetIconPosition(FX_FLOAT& fLeft, FX_FLOAT& fBottom);
+  void GetIconPosition(float& fLeft, float& fBottom);
 
   void SetIconFit(CPDF_IconFit* pIconFit) { m_pIconFit = pIconFit; }
 
diff --git a/fpdfsdk/pdfwindow/PWL_ListBox.cpp b/fpdfsdk/pdfwindow/PWL_ListBox.cpp
index 18b45b5..8448204 100644
--- a/fpdfsdk/pdfwindow/PWL_ListBox.cpp
+++ b/fpdfsdk/pdfwindow/PWL_ListBox.cpp
@@ -22,12 +22,12 @@
 
 CPWL_List_Notify::~CPWL_List_Notify() {}
 
-void CPWL_List_Notify::IOnSetScrollInfoY(FX_FLOAT fPlateMin,
-                                         FX_FLOAT fPlateMax,
-                                         FX_FLOAT fContentMin,
-                                         FX_FLOAT fContentMax,
-                                         FX_FLOAT fSmallStep,
-                                         FX_FLOAT fBigStep) {
+void CPWL_List_Notify::IOnSetScrollInfoY(float fPlateMin,
+                                         float fPlateMax,
+                                         float fContentMin,
+                                         float fContentMax,
+                                         float fSmallStep,
+                                         float fBigStep) {
   PWL_SCROLL_INFO Info;
 
   Info.fPlateWidth = fPlateMax - fPlateMin;
@@ -54,7 +54,7 @@
   }
 }
 
-void CPWL_List_Notify::IOnSetScrollPosY(FX_FLOAT fy) {
+void CPWL_List_Notify::IOnSetScrollPosY(float fy) {
   m_pList->OnNotify(m_pList, PNM_SETSCROLLPOS, SBT_VSCROLL, (intptr_t)&fy);
 }
 
@@ -295,7 +295,7 @@
                             intptr_t lParam) {
   CPWL_Wnd::OnNotify(pWnd, msg, wParam, lParam);
 
-  FX_FLOAT fPos;
+  float fPos;
 
   switch (msg) {
     case PNM_SETSCROLLINFO:
@@ -317,7 +317,7 @@
       }
       break;
     case PNM_SCROLLWINDOW:
-      fPos = *(FX_FLOAT*)lParam;
+      fPos = *(float*)lParam;
       switch (wParam) {
         case SBT_VSCROLL:
           m_pList->SetScrollPos(CFX_PointF(0, fPos));
@@ -371,11 +371,11 @@
   return m_pList->GetText();
 }
 
-void CPWL_ListBox::SetFontSize(FX_FLOAT fFontSize) {
+void CPWL_ListBox::SetFontSize(float fFontSize) {
   m_pList->SetFontSize(fFontSize);
 }
 
-FX_FLOAT CPWL_ListBox::GetFontSize() const {
+float CPWL_ListBox::GetFontSize() const {
   return m_pList->GetFontSize();
 }
 
@@ -436,13 +436,13 @@
   return m_pList->GetContentRect();
 }
 
-FX_FLOAT CPWL_ListBox::GetFirstHeight() const {
+float CPWL_ListBox::GetFirstHeight() const {
   return m_pList->GetFirstHeight();
 }
 
 CFX_FloatRect CPWL_ListBox::GetListRect() const {
   return CPWL_Utils::DeflateRect(
-      GetWindowRect(), (FX_FLOAT)(GetBorderWidth() + GetInnerBorderWidth()));
+      GetWindowRect(), (float)(GetBorderWidth() + GetInnerBorderWidth()));
 }
 
 bool CPWL_ListBox::OnMouseWheel(short zDelta,
diff --git a/fpdfsdk/pdfwindow/PWL_ListBox.h b/fpdfsdk/pdfwindow/PWL_ListBox.h
index fa78b37..9f8f464 100644
--- a/fpdfsdk/pdfwindow/PWL_ListBox.h
+++ b/fpdfsdk/pdfwindow/PWL_ListBox.h
@@ -25,13 +25,13 @@
   explicit CPWL_List_Notify(CPWL_ListBox* pList);
   ~CPWL_List_Notify();
 
-  void IOnSetScrollInfoY(FX_FLOAT fPlateMin,
-                         FX_FLOAT fPlateMax,
-                         FX_FLOAT fContentMin,
-                         FX_FLOAT fContentMax,
-                         FX_FLOAT fSmallStep,
-                         FX_FLOAT fBigStep);
-  void IOnSetScrollPosY(FX_FLOAT fy);
+  void IOnSetScrollInfoY(float fPlateMin,
+                         float fPlateMax,
+                         float fContentMin,
+                         float fContentMax,
+                         float fSmallStep,
+                         float fBigStep);
+  void IOnSetScrollPosY(float fy);
   void IOnInvalidateRect(CFX_FloatRect* pRect);
 
   void IOnSetCaret(bool bVisible,
@@ -70,8 +70,8 @@
                 intptr_t lParam = 0) override;
   void RePosChildWnd() override;
   CFX_FloatRect GetFocusRect() const override;
-  void SetFontSize(FX_FLOAT fFontSize) override;
-  FX_FLOAT GetFontSize() const override;
+  void SetFontSize(float fFontSize) override;
+  float GetFontSize() const override;
 
   virtual CFX_WideString GetText() const;
 
@@ -94,7 +94,7 @@
   int32_t GetTopVisibleIndex() const;
   int32_t FindNext(int32_t nIndex, wchar_t nChar) const;
   CFX_FloatRect GetContentRect() const;
-  FX_FLOAT GetFirstHeight() const;
+  float GetFirstHeight() const;
   CFX_FloatRect GetListRect() const;
 
   void SetFillerNotify(IPWL_Filler_Notify* pNotify) {
diff --git a/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp b/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp
index e379936..9289f44 100644
--- a/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp
+++ b/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp
@@ -15,7 +15,7 @@
   Default();
 }
 
-PWL_FLOATRANGE::PWL_FLOATRANGE(FX_FLOAT min, FX_FLOAT max) {
+PWL_FLOATRANGE::PWL_FLOATRANGE(float min, float max) {
   Set(min, max);
 }
 
@@ -24,7 +24,7 @@
   fMax = 0;
 }
 
-void PWL_FLOATRANGE::Set(FX_FLOAT min, FX_FLOAT max) {
+void PWL_FLOATRANGE::Set(float min, float max) {
   if (min > max) {
     fMin = max;
     fMax = min;
@@ -34,12 +34,12 @@
   }
 }
 
-bool PWL_FLOATRANGE::In(FX_FLOAT x) const {
+bool PWL_FLOATRANGE::In(float x) const {
   return (IsFloatBigger(x, fMin) || IsFloatEqual(x, fMin)) &&
          (IsFloatSmaller(x, fMax) || IsFloatEqual(x, fMax));
 }
 
-FX_FLOAT PWL_FLOATRANGE::GetWidth() const {
+float PWL_FLOATRANGE::GetWidth() const {
   return fMax - fMin;
 }
 
@@ -55,7 +55,7 @@
   fSmallStep = 1;
 }
 
-void PWL_SCROLL_PRIVATEDATA::SetScrollRange(FX_FLOAT min, FX_FLOAT max) {
+void PWL_SCROLL_PRIVATEDATA::SetScrollRange(float min, float max) {
   ScrollRange.Set(min, max);
 
   if (IsFloatSmaller(fScrollPos, ScrollRange.fMin))
@@ -64,19 +64,19 @@
     fScrollPos = ScrollRange.fMax;
 }
 
-void PWL_SCROLL_PRIVATEDATA::SetClientWidth(FX_FLOAT width) {
+void PWL_SCROLL_PRIVATEDATA::SetClientWidth(float width) {
   fClientWidth = width;
 }
 
-void PWL_SCROLL_PRIVATEDATA::SetSmallStep(FX_FLOAT step) {
+void PWL_SCROLL_PRIVATEDATA::SetSmallStep(float step) {
   fSmallStep = step;
 }
 
-void PWL_SCROLL_PRIVATEDATA::SetBigStep(FX_FLOAT step) {
+void PWL_SCROLL_PRIVATEDATA::SetBigStep(float step) {
   fBigStep = step;
 }
 
-bool PWL_SCROLL_PRIVATEDATA::SetPos(FX_FLOAT pos) {
+bool PWL_SCROLL_PRIVATEDATA::SetPos(float pos) {
   if (ScrollRange.In(pos)) {
     fScrollPos = pos;
     return true;
@@ -320,8 +320,8 @@
           // draw arrow
 
           if (rectWnd.top - rectWnd.bottom > 6.0f) {
-            FX_FLOAT fX = rectWnd.left + 1.5f;
-            FX_FLOAT fY = rectWnd.bottom;
+            float fX = rectWnd.left + 1.5f;
+            float fY = rectWnd.bottom;
             CFX_PointF pts[7] = {CFX_PointF(fX + 2.5f, fY + 4.0f),
                                  CFX_PointF(fX + 2.5f, fY + 3.0f),
                                  CFX_PointF(fX + 4.5f, fY + 5.0f),
@@ -365,8 +365,8 @@
           // draw arrow
 
           if (rectWnd.top - rectWnd.bottom > 6.0f) {
-            FX_FLOAT fX = rectWnd.left + 1.5f;
-            FX_FLOAT fY = rectWnd.bottom;
+            float fX = rectWnd.left + 1.5f;
+            float fY = rectWnd.bottom;
 
             CFX_PointF pts[7] = {CFX_PointF(fX + 2.5f, fY + 5.0f),
                                  CFX_PointF(fX + 2.5f, fY + 6.0f),
@@ -487,8 +487,8 @@
             if (!IsEnabled())
               crStroke = PWL_DEFAULT_HEAVYGRAYCOLOR.ToFXColor(255);
 
-            FX_FLOAT nFrictionWidth = 5.0f;
-            FX_FLOAT nFrictionHeight = 5.5f;
+            float nFrictionWidth = 5.0f;
+            float nFrictionHeight = 5.5f;
 
             CFX_PointF ptLeft =
                 CFX_PointF(ptCenter.x - nFrictionWidth / 2.0f,
@@ -578,7 +578,7 @@
 void CPWL_ScrollBar::RePosChildWnd() {
   CFX_FloatRect rcClient = GetClientRect();
   CFX_FloatRect rcMinButton, rcMaxButton;
-  FX_FLOAT fBWidth = 0;
+  float fBWidth = 0;
 
   switch (m_sbType) {
     case SBT_HSCROLL:
@@ -802,7 +802,7 @@
       PWL_SCROLL_INFO* pInfo = reinterpret_cast<PWL_SCROLL_INFO*>(lParam);
       if (pInfo && *pInfo != m_OriginInfo) {
         m_OriginInfo = *pInfo;
-        FX_FLOAT fMax =
+        float fMax =
             pInfo->fContentMax - pInfo->fContentMin - pInfo->fPlateWidth;
         fMax = fMax > 0.0f ? fMax : 0.0f;
         SetScrollRange(0, fMax, pInfo->fPlateWidth);
@@ -810,7 +810,7 @@
       }
     } break;
     case PNM_SETSCROLLPOS: {
-      FX_FLOAT fPos = *(FX_FLOAT*)lParam;
+      float fPos = *(float*)lParam;
       switch (m_sbType) {
         case SBT_HSCROLL:
           fPos = fPos - m_OriginInfo.fContentMin;
@@ -850,16 +850,16 @@
   }
 }
 
-FX_FLOAT CPWL_ScrollBar::GetScrollBarWidth() const {
+float CPWL_ScrollBar::GetScrollBarWidth() const {
   if (!IsVisible())
     return 0;
 
   return PWL_SCROLLBAR_WIDTH;
 }
 
-void CPWL_ScrollBar::SetScrollRange(FX_FLOAT fMin,
-                                    FX_FLOAT fMax,
-                                    FX_FLOAT fClientWidth) {
+void CPWL_ScrollBar::SetScrollRange(float fMin,
+                                    float fMax,
+                                    float fClientWidth) {
   if (m_pPosButton) {
     m_sData.SetScrollRange(fMin, fMax);
     m_sData.SetClientWidth(fClientWidth);
@@ -873,8 +873,8 @@
   }
 }
 
-void CPWL_ScrollBar::SetScrollPos(FX_FLOAT fPos) {
-  FX_FLOAT fOldPos = m_sData.fScrollPos;
+void CPWL_ScrollBar::SetScrollPos(float fPos) {
+  float fOldPos = m_sData.fScrollPos;
 
   m_sData.SetPos(fPos);
 
@@ -882,7 +882,7 @@
     MovePosButton(true);
 }
 
-void CPWL_ScrollBar::SetScrollStep(FX_FLOAT fBigStep, FX_FLOAT fSmallStep) {
+void CPWL_ScrollBar::SetScrollStep(float fBigStep, float fSmallStep) {
   m_sData.SetBigStep(fBigStep);
   m_sData.SetSmallStep(fSmallStep);
 }
@@ -898,7 +898,7 @@
     rcClient = GetClientRect();
     rcPosArea = GetScrollArea();
 
-    FX_FLOAT fLeft, fRight, fTop, fBottom;
+    float fLeft, fRight, fTop, fBottom;
 
     switch (m_sbType) {
       case SBT_HSCROLL:
@@ -997,9 +997,9 @@
 }
 
 void CPWL_ScrollBar::OnPosButtonMouseMove(const CFX_PointF& point) {
-  FX_FLOAT fOldScrollPos = m_sData.fScrollPos;
+  float fOldScrollPos = m_sData.fScrollPos;
 
-  FX_FLOAT fNewPos = 0;
+  float fNewPos = 0;
 
   switch (m_sbType) {
     case SBT_HSCROLL:
@@ -1055,7 +1055,7 @@
 
 void CPWL_ScrollBar::NotifyScrollWindow() {
   if (CPWL_Wnd* pParent = GetParentWindow()) {
-    FX_FLOAT fPos;
+    float fPos;
     switch (m_sbType) {
       case SBT_HSCROLL:
         fPos = m_OriginInfo.fContentMin + m_sData.fScrollPos;
@@ -1079,10 +1079,10 @@
   CFX_FloatRect rcMin = m_pMinButton->GetWindowRect();
   CFX_FloatRect rcMax = m_pMaxButton->GetWindowRect();
 
-  FX_FLOAT fMinWidth = rcMin.right - rcMin.left;
-  FX_FLOAT fMinHeight = rcMin.top - rcMin.bottom;
-  FX_FLOAT fMaxWidth = rcMax.right - rcMax.left;
-  FX_FLOAT fMaxHeight = rcMax.top - rcMax.bottom;
+  float fMinWidth = rcMin.right - rcMin.left;
+  float fMinHeight = rcMin.top - rcMin.bottom;
+  float fMaxWidth = rcMax.right - rcMax.left;
+  float fMaxHeight = rcMax.top - rcMax.bottom;
 
   switch (m_sbType) {
     case SBT_HSCROLL:
@@ -1111,14 +1111,14 @@
   return rcArea;
 }
 
-FX_FLOAT CPWL_ScrollBar::TrueToFace(FX_FLOAT fTrue) {
+float CPWL_ScrollBar::TrueToFace(float fTrue) {
   CFX_FloatRect rcPosArea;
   rcPosArea = GetScrollArea();
 
-  FX_FLOAT fFactWidth = m_sData.ScrollRange.GetWidth() + m_sData.fClientWidth;
+  float fFactWidth = m_sData.ScrollRange.GetWidth() + m_sData.fClientWidth;
   fFactWidth = fFactWidth == 0 ? 1 : fFactWidth;
 
-  FX_FLOAT fFace = 0;
+  float fFace = 0;
 
   switch (m_sbType) {
     case SBT_HSCROLL:
@@ -1134,14 +1134,14 @@
   return fFace;
 }
 
-FX_FLOAT CPWL_ScrollBar::FaceToTrue(FX_FLOAT fFace) {
+float CPWL_ScrollBar::FaceToTrue(float fFace) {
   CFX_FloatRect rcPosArea;
   rcPosArea = GetScrollArea();
 
-  FX_FLOAT fFactWidth = m_sData.ScrollRange.GetWidth() + m_sData.fClientWidth;
+  float fFactWidth = m_sData.ScrollRange.GetWidth() + m_sData.fClientWidth;
   fFactWidth = fFactWidth == 0 ? 1 : fFactWidth;
 
-  FX_FLOAT fTrue = 0;
+  float fTrue = 0;
 
   switch (m_sbType) {
     case SBT_HSCROLL:
diff --git a/fpdfsdk/pdfwindow/PWL_ScrollBar.h b/fpdfsdk/pdfwindow/PWL_ScrollBar.h
index 9546a9e..50b0801 100644
--- a/fpdfsdk/pdfwindow/PWL_ScrollBar.h
+++ b/fpdfsdk/pdfwindow/PWL_ScrollBar.h
@@ -30,11 +30,11 @@
     return !(*this == that);
   }
 
-  FX_FLOAT fContentMin;
-  FX_FLOAT fContentMax;
-  FX_FLOAT fPlateWidth;
-  FX_FLOAT fBigStep;
-  FX_FLOAT fSmallStep;
+  float fContentMin;
+  float fContentMax;
+  float fPlateWidth;
+  float fBigStep;
+  float fSmallStep;
 };
 
 enum PWL_SCROLLBAR_TYPE { SBT_HSCROLL, SBT_VSCROLL };
@@ -67,7 +67,7 @@
 struct PWL_FLOATRANGE {
  public:
   PWL_FLOATRANGE();
-  PWL_FLOATRANGE(FX_FLOAT min, FX_FLOAT max);
+  PWL_FLOATRANGE(float min, float max);
 
   bool operator==(const PWL_FLOATRANGE& that) const {
     return fMin == that.fMin && fMax == that.fMax;
@@ -75,12 +75,12 @@
   bool operator!=(const PWL_FLOATRANGE& that) const { return !(*this == that); }
 
   void Default();
-  void Set(FX_FLOAT min, FX_FLOAT max);
-  bool In(FX_FLOAT x) const;
-  FX_FLOAT GetWidth() const;
+  void Set(float min, float max);
+  bool In(float x) const;
+  float GetWidth() const;
 
-  FX_FLOAT fMin;
-  FX_FLOAT fMax;
+  float fMin;
+  float fMax;
 };
 
 struct PWL_SCROLL_PRIVATEDATA {
@@ -97,11 +97,11 @@
   }
 
   void Default();
-  void SetScrollRange(FX_FLOAT min, FX_FLOAT max);
-  void SetClientWidth(FX_FLOAT width);
-  void SetSmallStep(FX_FLOAT step);
-  void SetBigStep(FX_FLOAT step);
-  bool SetPos(FX_FLOAT pos);
+  void SetScrollRange(float min, float max);
+  void SetClientWidth(float width);
+  void SetSmallStep(float step);
+  void SetBigStep(float step);
+  bool SetPos(float pos);
 
   void AddSmall();
   void SubSmall();
@@ -109,10 +109,10 @@
   void SubBig();
 
   PWL_FLOATRANGE ScrollRange;
-  FX_FLOAT fClientWidth;
-  FX_FLOAT fScrollPos;
-  FX_FLOAT fBigStep;
-  FX_FLOAT fSmallStep;
+  float fClientWidth;
+  float fScrollPos;
+  float fBigStep;
+  float fSmallStep;
 };
 
 class CPWL_ScrollBar : public CPWL_Wnd {
@@ -136,16 +136,16 @@
   void CreateChildWnd(const PWL_CREATEPARAM& cp) override;
   void TimerProc() override;
 
-  FX_FLOAT GetScrollBarWidth() const;
+  float GetScrollBarWidth() const;
   PWL_SCROLLBAR_TYPE GetScrollBarType() const { return m_sbType; }
 
   void SetNotifyForever(bool bForever) { m_bNotifyForever = bForever; }
 
  protected:
-  void SetScrollRange(FX_FLOAT fMin, FX_FLOAT fMax, FX_FLOAT fClientWidth);
-  void SetScrollPos(FX_FLOAT fPos);
+  void SetScrollRange(float fMin, float fMax, float fClientWidth);
+  void SetScrollPos(float fPos);
   void MovePosButton(bool bRefresh);
-  void SetScrollStep(FX_FLOAT fBigStep, FX_FLOAT fSmallStep);
+  void SetScrollStep(float fBigStep, float fSmallStep);
   void NotifyScrollWindow();
   CFX_FloatRect GetScrollArea() const;
 
@@ -164,8 +164,8 @@
   void OnPosButtonLBUp(const CFX_PointF& point);
   void OnPosButtonMouseMove(const CFX_PointF& point);
 
-  FX_FLOAT TrueToFace(FX_FLOAT);
-  FX_FLOAT FaceToTrue(FX_FLOAT);
+  float TrueToFace(float);
+  float FaceToTrue(float);
 
   PWL_SCROLLBAR_TYPE m_sbType;
   PWL_SCROLL_INFO m_OriginInfo;
@@ -176,8 +176,8 @@
   bool m_bMouseDown;
   bool m_bMinOrMax;
   bool m_bNotifyForever;
-  FX_FLOAT m_nOldPos;
-  FX_FLOAT m_fOldPosButton;
+  float m_nOldPos;
+  float m_fOldPosButton;
 };
 
 #endif  // FPDFSDK_PDFWINDOW_PWL_SCROLLBAR_H_
diff --git a/fpdfsdk/pdfwindow/PWL_SpecialButton.cpp b/fpdfsdk/pdfwindow/PWL_SpecialButton.cpp
index 1c46c37..d2a1321 100644
--- a/fpdfsdk/pdfwindow/PWL_SpecialButton.cpp
+++ b/fpdfsdk/pdfwindow/PWL_SpecialButton.cpp
@@ -18,7 +18,7 @@
 }
 
 CFX_FloatRect CPWL_PushButton::GetFocusRect() const {
-  return CPWL_Utils::DeflateRect(GetWindowRect(), (FX_FLOAT)GetBorderWidth());
+  return CPWL_Utils::DeflateRect(GetWindowRect(), (float)GetBorderWidth());
 }
 
 CPWL_CheckBox::CPWL_CheckBox() : m_bChecked(false) {}
diff --git a/fpdfsdk/pdfwindow/PWL_Utils.cpp b/fpdfsdk/pdfwindow/PWL_Utils.cpp
index 45668b6..f78b590 100644
--- a/fpdfsdk/pdfwindow/PWL_Utils.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Utils.cpp
@@ -18,8 +18,8 @@
 #include "fpdfsdk/pdfwindow/PWL_Wnd.h"
 
 CFX_FloatRect CPWL_Utils::OffsetRect(const CFX_FloatRect& rect,
-                                     FX_FLOAT x,
-                                     FX_FLOAT y) {
+                                     float x,
+                                     float y) {
   return CFX_FloatRect(rect.left + x, rect.bottom + y, rect.right + x,
                        rect.top + y);
 }
@@ -51,8 +51,8 @@
 }
 
 CFX_ByteString CPWL_Utils::GetAP_Check(const CFX_FloatRect& crBBox) {
-  const FX_FLOAT fWidth = crBBox.right - crBBox.left;
-  const FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
+  const float fWidth = crBBox.right - crBBox.left;
+  const float fHeight = crBBox.top - crBBox.bottom;
 
   CFX_PointF pts[8][3] = {{CFX_PointF(0.28f, 0.52f), CFX_PointF(0.27f, 0.48f),
                            CFX_PointF(0.29f, 0.40f)},
@@ -84,10 +84,10 @@
   for (size_t i = 0; i < FX_ArraySize(pts); ++i) {
     size_t nNext = i < FX_ArraySize(pts) - 1 ? i + 1 : 0;
 
-    FX_FLOAT px1 = pts[i][1].x - pts[i][0].x;
-    FX_FLOAT py1 = pts[i][1].y - pts[i][0].y;
-    FX_FLOAT px2 = pts[i][2].x - pts[nNext][0].x;
-    FX_FLOAT py2 = pts[i][2].y - pts[nNext][0].y;
+    float px1 = pts[i][1].x - pts[i][0].x;
+    float py1 = pts[i][1].y - pts[i][0].y;
+    float px2 = pts[i][2].x - pts[nNext][0].x;
+    float py2 = pts[i][2].y - pts[nNext][0].y;
 
     csAP << pts[i][0].x + px1 * FX_BEZIER << " "
          << pts[i][0].y + py1 * FX_BEZIER << " "
@@ -102,8 +102,8 @@
 CFX_ByteString CPWL_Utils::GetAP_Circle(const CFX_FloatRect& crBBox) {
   CFX_ByteTextBuf csAP;
 
-  FX_FLOAT fWidth = crBBox.right - crBBox.left;
-  FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
+  float fWidth = crBBox.right - crBBox.left;
+  float fHeight = crBBox.top - crBBox.bottom;
 
   CFX_PointF pt1(crBBox.left, crBBox.bottom + fHeight / 2);
   CFX_PointF pt2(crBBox.left + fWidth / 2, crBBox.top);
@@ -112,8 +112,8 @@
 
   csAP << pt1.x << " " << pt1.y << " m\n";
 
-  FX_FLOAT px = pt2.x - pt1.x;
-  FX_FLOAT py = pt2.y - pt1.y;
+  float px = pt2.x - pt1.x;
+  float py = pt2.y - pt1.y;
 
   csAP << pt1.x << " " << pt1.y + py * FX_BEZIER << " "
        << pt2.x - px * FX_BEZIER << " " << pt2.y << " " << pt2.x << " " << pt2.y
@@ -155,8 +155,8 @@
 CFX_ByteString CPWL_Utils::GetAP_Diamond(const CFX_FloatRect& crBBox) {
   CFX_ByteTextBuf csAP;
 
-  FX_FLOAT fWidth = crBBox.right - crBBox.left;
-  FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
+  float fWidth = crBBox.right - crBBox.left;
+  float fHeight = crBBox.top - crBBox.bottom;
 
   CFX_PointF pt1(crBBox.left, crBBox.bottom + fHeight / 2);
   CFX_PointF pt2(crBBox.left + fWidth / 2, crBBox.top);
@@ -187,18 +187,17 @@
 CFX_ByteString CPWL_Utils::GetAP_Star(const CFX_FloatRect& crBBox) {
   CFX_ByteTextBuf csAP;
 
-  FX_FLOAT fRadius =
-      (crBBox.top - crBBox.bottom) / (1 + (FX_FLOAT)cos(FX_PI / 5.0f));
+  float fRadius = (crBBox.top - crBBox.bottom) / (1 + (float)cos(FX_PI / 5.0f));
   CFX_PointF ptCenter = CFX_PointF((crBBox.left + crBBox.right) / 2.0f,
                                    (crBBox.top + crBBox.bottom) / 2.0f);
 
-  FX_FLOAT px[5], py[5];
+  float px[5], py[5];
 
-  FX_FLOAT fAngel = FX_PI / 10.0f;
+  float fAngel = FX_PI / 10.0f;
 
   for (int32_t i = 0; i < 5; i++) {
-    px[i] = ptCenter.x + fRadius * (FX_FLOAT)cos(fAngel);
-    py[i] = ptCenter.y + fRadius * (FX_FLOAT)sin(fAngel);
+    px[i] = ptCenter.x + fRadius * (float)cos(fAngel);
+    py[i] = ptCenter.y + fRadius * (float)sin(fAngel);
 
     fAngel += FX_PI * 2 / 5.0f;
   }
@@ -217,17 +216,17 @@
 }
 
 CFX_ByteString CPWL_Utils::GetAP_HalfCircle(const CFX_FloatRect& crBBox,
-                                            FX_FLOAT fRotate) {
+                                            float fRotate) {
   CFX_ByteTextBuf csAP;
 
-  FX_FLOAT fWidth = crBBox.right - crBBox.left;
-  FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
+  float fWidth = crBBox.right - crBBox.left;
+  float fHeight = crBBox.top - crBBox.bottom;
 
   CFX_PointF pt1(-fWidth / 2, 0);
   CFX_PointF pt2(0, fHeight / 2);
   CFX_PointF pt3(fWidth / 2, 0);
 
-  FX_FLOAT px, py;
+  float px, py;
 
   csAP << cos(fRotate) << " " << sin(fRotate) << " " << -sin(fRotate) << " "
        << cos(fRotate) << " " << crBBox.left + fWidth / 2 << " "
@@ -252,7 +251,7 @@
 }
 
 CFX_FloatRect CPWL_Utils::InflateRect(const CFX_FloatRect& rcRect,
-                                      FX_FLOAT fSize) {
+                                      float fSize) {
   if (rcRect.IsEmpty())
     return rcRect;
 
@@ -263,7 +262,7 @@
 }
 
 CFX_FloatRect CPWL_Utils::DeflateRect(const CFX_FloatRect& rcRect,
-                                      FX_FLOAT fSize) {
+                                      float fSize) {
   if (rcRect.IsEmpty())
     return rcRect;
 
@@ -273,10 +272,9 @@
   return rcNew;
 }
 
-CFX_FloatRect CPWL_Utils::ScaleRect(const CFX_FloatRect& rcRect,
-                                    FX_FLOAT fScale) {
-  FX_FLOAT fHalfWidth = (rcRect.right - rcRect.left) / 2.0f;
-  FX_FLOAT fHalfHeight = (rcRect.top - rcRect.bottom) / 2.0f;
+CFX_FloatRect CPWL_Utils::ScaleRect(const CFX_FloatRect& rcRect, float fScale) {
+  float fHalfWidth = (rcRect.right - rcRect.left) / 2.0f;
+  float fHalfHeight = (rcRect.top - rcRect.bottom) / 2.0f;
 
   CFX_PointF ptCenter = CFX_PointF((rcRect.left + rcRect.right) / 2,
                                    (rcRect.top + rcRect.bottom) / 2);
@@ -311,13 +309,13 @@
 }
 
 CFX_FloatRect CPWL_Utils::GetCenterSquare(const CFX_FloatRect& rect) {
-  FX_FLOAT fWidth = rect.right - rect.left;
-  FX_FLOAT fHeight = rect.top - rect.bottom;
+  float fWidth = rect.right - rect.left;
+  float fHeight = rect.top - rect.bottom;
 
-  FX_FLOAT fCenterX = (rect.left + rect.right) / 2.0f;
-  FX_FLOAT fCenterY = (rect.top + rect.bottom) / 2.0f;
+  float fCenterX = (rect.left + rect.right) / 2.0f;
+  float fCenterY = (rect.top + rect.bottom) / 2.0f;
 
-  FX_FLOAT fRadius = (fWidth > fHeight) ? fHeight / 2 : fWidth / 2;
+  float fRadius = (fWidth > fHeight) ? fHeight / 2 : fWidth / 2;
 
   return CFX_FloatRect(fCenterX - fRadius, fCenterY - fRadius,
                        fCenterX + fRadius, fCenterY + fRadius);
@@ -344,9 +342,9 @@
                                                   CPDF_IconFit& IconFit,
                                                   const CFX_WideString& sLabel,
                                                   const CPWL_Color& crText,
-                                                  FX_FLOAT fFontSize,
+                                                  float fFontSize,
                                                   int32_t nLayOut) {
-  const FX_FLOAT fAutoFontScale = 1.0f / 3.0f;
+  const float fAutoFontScale = 1.0f / 3.0f;
 
   std::unique_ptr<CFX_Edit> pEdit(new CFX_Edit);
   pEdit->SetFontMap(pFontMap);
@@ -372,8 +370,8 @@
 
   CFX_FloatRect rcLabel = CFX_FloatRect(0, 0, 0, 0);
   CFX_FloatRect rcIcon = CFX_FloatRect(0, 0, 0, 0);
-  FX_FLOAT fWidth = 0.0f;
-  FX_FLOAT fHeight = 0.0f;
+  float fWidth = 0.0f;
+  float fHeight = 0.0f;
 
   switch (nLayOut) {
     case PPBL_LABEL:
@@ -585,7 +583,7 @@
 }
 
 CFX_ByteString CPWL_Utils::GetBorderAppStream(const CFX_FloatRect& rect,
-                                              FX_FLOAT fWidth,
+                                              float fWidth,
                                               const CPWL_Color& color,
                                               const CPWL_Color& crLeftTop,
                                               const CPWL_Color& crRightBottom,
@@ -594,13 +592,13 @@
   CFX_ByteTextBuf sAppStream;
   CFX_ByteString sColor;
 
-  FX_FLOAT fLeft = rect.left;
-  FX_FLOAT fRight = rect.right;
-  FX_FLOAT fTop = rect.top;
-  FX_FLOAT fBottom = rect.bottom;
+  float fLeft = rect.left;
+  float fRight = rect.right;
+  float fTop = rect.top;
+  float fBottom = rect.bottom;
 
   if (fWidth > 0.0f) {
-    FX_FLOAT fHalfWidth = fWidth / 2.0f;
+    float fHalfWidth = fWidth / 2.0f;
 
     sAppStream << "q\n";
 
@@ -702,7 +700,7 @@
 
 CFX_ByteString CPWL_Utils::GetCircleBorderAppStream(
     const CFX_FloatRect& rect,
-    FX_FLOAT fWidth,
+    float fWidth,
     const CPWL_Color& color,
     const CPWL_Color& crLeftTop,
     const CPWL_Color& crRightBottom,
@@ -738,7 +736,7 @@
         }
       } break;
       case BorderStyle::BEVELED: {
-        FX_FLOAT fHalfWidth = fWidth / 2.0f;
+        float fHalfWidth = fWidth / 2.0f;
 
         sColor = CPWL_Utils::GetColorAppStream(color, false);
         if (sColor.GetLength() > 0) {
@@ -765,7 +763,7 @@
         }
       } break;
       case BorderStyle::INSET: {
-        FX_FLOAT fHalfWidth = fWidth / 2.0f;
+        float fHalfWidth = fWidth / 2.0f;
 
         sColor = CPWL_Utils::GetColorAppStream(color, false);
         if (sColor.GetLength() > 0) {
@@ -961,7 +959,7 @@
                                 CFX_Matrix* pUser2Device,
                                 const CFX_FloatRect& rect,
                                 const FX_COLORREF& color,
-                                FX_FLOAT fWidth) {
+                                float fWidth) {
   CFX_PathData path;
   CFX_FloatRect rcTemp(rect);
   path.AppendRect(rcTemp.left, rcTemp.bottom, rcTemp.right, rcTemp.top);
@@ -977,7 +975,7 @@
                                 const CFX_PointF& ptMoveTo,
                                 const CFX_PointF& ptLineTo,
                                 const FX_COLORREF& color,
-                                FX_FLOAT fWidth) {
+                                float fWidth) {
   CFX_PathData path;
   path.AppendPoint(ptMoveTo, FXPT_TYPE::MoveTo, false);
   path.AppendPoint(ptLineTo, FXPT_TYPE::LineTo, false);
@@ -1005,12 +1003,12 @@
                             int32_t nTransparency,
                             int32_t nStartGray,
                             int32_t nEndGray) {
-  FX_FLOAT fStepGray = 1.0f;
+  float fStepGray = 1.0f;
 
   if (bVertical) {
     fStepGray = (nEndGray - nStartGray) / rect.Height();
 
-    for (FX_FLOAT fy = rect.bottom + 0.5f; fy <= rect.top - 0.5f; fy += 1.0f) {
+    for (float fy = rect.bottom + 0.5f; fy <= rect.top - 0.5f; fy += 1.0f) {
       int32_t nGray = nStartGray + (int32_t)(fStepGray * (fy - rect.bottom));
       CPWL_Utils::DrawStrokeLine(
           pDevice, pUser2Device, CFX_PointF(rect.left, fy),
@@ -1022,7 +1020,7 @@
   if (bHorizontal) {
     fStepGray = (nEndGray - nStartGray) / rect.Width();
 
-    for (FX_FLOAT fx = rect.left + 0.5f; fx <= rect.right - 0.5f; fx += 1.0f) {
+    for (float fx = rect.left + 0.5f; fx <= rect.right - 0.5f; fx += 1.0f) {
       int32_t nGray = nStartGray + (int32_t)(fStepGray * (fx - rect.left));
       CPWL_Utils::DrawStrokeLine(
           pDevice, pUser2Device, CFX_PointF(fx, rect.bottom),
@@ -1035,19 +1033,19 @@
 void CPWL_Utils::DrawBorder(CFX_RenderDevice* pDevice,
                             CFX_Matrix* pUser2Device,
                             const CFX_FloatRect& rect,
-                            FX_FLOAT fWidth,
+                            float fWidth,
                             const CPWL_Color& color,
                             const CPWL_Color& crLeftTop,
                             const CPWL_Color& crRightBottom,
                             BorderStyle nStyle,
                             int32_t nTransparency) {
-  FX_FLOAT fLeft = rect.left;
-  FX_FLOAT fRight = rect.right;
-  FX_FLOAT fTop = rect.top;
-  FX_FLOAT fBottom = rect.bottom;
+  float fLeft = rect.left;
+  float fRight = rect.right;
+  float fTop = rect.top;
+  float fBottom = rect.bottom;
 
   if (fWidth > 0.0f) {
-    FX_FLOAT fHalfWidth = fWidth / 2.0f;
+    float fHalfWidth = fWidth / 2.0f;
 
     switch (nStyle) {
       default:
diff --git a/fpdfsdk/pdfwindow/PWL_Utils.h b/fpdfsdk/pdfwindow/PWL_Utils.h
index a4ecc19..29fe239 100644
--- a/fpdfsdk/pdfwindow/PWL_Utils.h
+++ b/fpdfsdk/pdfwindow/PWL_Utils.h
@@ -35,21 +35,19 @@
 
 class CPWL_Utils {
  public:
-  static CFX_FloatRect InflateRect(const CFX_FloatRect& rcRect, FX_FLOAT fSize);
-  static CFX_FloatRect DeflateRect(const CFX_FloatRect& rcRect, FX_FLOAT fSize);
+  static CFX_FloatRect InflateRect(const CFX_FloatRect& rcRect, float fSize);
+  static CFX_FloatRect DeflateRect(const CFX_FloatRect& rcRect, float fSize);
 
   static CPVT_WordRange OverlapWordRange(const CPVT_WordRange& wr1,
                                          const CPVT_WordRange& wr2);
   static CFX_FloatRect GetCenterSquare(const CFX_FloatRect& rect);
 
-  static CFX_FloatRect OffsetRect(const CFX_FloatRect& rect,
-                                  FX_FLOAT x,
-                                  FX_FLOAT y);
+  static CFX_FloatRect OffsetRect(const CFX_FloatRect& rect, float x, float y);
 
   static CFX_ByteString GetColorAppStream(const CPWL_Color& color,
                                           const bool& bFillOrStroke = true);
   static CFX_ByteString GetBorderAppStream(const CFX_FloatRect& rect,
-                                           FX_FLOAT fWidth,
+                                           float fWidth,
                                            const CPWL_Color& color,
                                            const CPWL_Color& crLeftTop,
                                            const CPWL_Color& crRightBottom,
@@ -57,7 +55,7 @@
                                            const CPWL_Dash& dash);
   static CFX_ByteString GetCircleBorderAppStream(
       const CFX_FloatRect& rect,
-      FX_FLOAT fWidth,
+      float fWidth,
       const CPWL_Color& color,
       const CPWL_Color& crLeftTop,
       const CPWL_Color& crRightBottom,
@@ -73,7 +71,7 @@
                                                CPDF_IconFit& IconFit,
                                                const CFX_WideString& sLabel,
                                                const CPWL_Color& crText,
-                                               FX_FLOAT fFontSize,
+                                               float fFontSize,
                                                int32_t nLayOut);
   static CFX_ByteString GetCheckBoxAppStream(const CFX_FloatRect& rcBBox,
                                              int32_t nStyle,
@@ -105,17 +103,17 @@
                              CFX_Matrix* pUser2Device,
                              const CFX_FloatRect& rect,
                              const FX_COLORREF& color,
-                             FX_FLOAT fWidth);
+                             float fWidth);
   static void DrawStrokeLine(CFX_RenderDevice* pDevice,
                              CFX_Matrix* pUser2Device,
                              const CFX_PointF& ptMoveTo,
                              const CFX_PointF& ptLineTo,
                              const FX_COLORREF& color,
-                             FX_FLOAT fWidth);
+                             float fWidth);
   static void DrawBorder(CFX_RenderDevice* pDevice,
                          CFX_Matrix* pUser2Device,
                          const CFX_FloatRect& rect,
-                         FX_FLOAT fWidth,
+                         float fWidth,
                          const CPWL_Color& color,
                          const CPWL_Color& crLeftTop,
                          const CPWL_Color& crRightBottom,
@@ -136,7 +134,7 @@
                          int32_t nEndGray);
 
  private:
-  static CFX_FloatRect ScaleRect(const CFX_FloatRect& rcRect, FX_FLOAT fScale);
+  static CFX_FloatRect ScaleRect(const CFX_FloatRect& rcRect, float fScale);
 
   static CFX_ByteString GetAppStream_Check(const CFX_FloatRect& rcBBox,
                                            const CPWL_Color& crText);
@@ -158,7 +156,7 @@
   static CFX_ByteString GetAP_Square(const CFX_FloatRect& crBBox);
   static CFX_ByteString GetAP_Star(const CFX_FloatRect& crBBox);
   static CFX_ByteString GetAP_HalfCircle(const CFX_FloatRect& crBBox,
-                                         FX_FLOAT fRotate);
+                                         float fRotate);
 };
 
 #endif  // FPDFSDK_PDFWINDOW_PWL_UTILS_H_
diff --git a/fpdfsdk/pdfwindow/PWL_Wnd.cpp b/fpdfsdk/pdfwindow/PWL_Wnd.cpp
index dc307a1..075b746 100644
--- a/fpdfsdk/pdfwindow/PWL_Wnd.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Wnd.cpp
@@ -319,7 +319,7 @@
 
     if (HasFlag(PWS_BORDER)) {
       sThis << CPWL_Utils::GetBorderAppStream(
-          rectWnd, (FX_FLOAT)GetBorderWidth(), GetBorderColor(),
+          rectWnd, (float)GetBorderWidth(), GetBorderColor(),
           GetBorderLeftTopColor(GetBorderStyle()),
           GetBorderRightBottomColor(GetBorderStyle()), GetBorderStyle(),
           GetBorderDash());
@@ -350,14 +350,14 @@
   if (!rectWnd.IsEmpty()) {
     if (HasFlag(PWS_BACKGROUND)) {
       CFX_FloatRect rcClient = CPWL_Utils::DeflateRect(
-          rectWnd, (FX_FLOAT)(GetBorderWidth() + GetInnerBorderWidth()));
+          rectWnd, (float)(GetBorderWidth() + GetInnerBorderWidth()));
       CPWL_Utils::DrawFillRect(pDevice, pUser2Device, rcClient,
                                GetBackgroundColor(), GetTransparency());
     }
 
     if (HasFlag(PWS_BORDER))
       CPWL_Utils::DrawBorder(pDevice, pUser2Device, rectWnd,
-                             (FX_FLOAT)GetBorderWidth(), GetBorderColor(),
+                             (float)GetBorderWidth(), GetBorderColor(),
                              GetBorderLeftTopColor(GetBorderStyle()),
                              GetBorderRightBottomColor(GetBorderStyle()),
                              GetBorderStyle(), GetTransparency());
@@ -520,7 +520,7 @@
 CFX_FloatRect CPWL_Wnd::GetClientRect() const {
   CFX_FloatRect rcWindow = GetWindowRect();
   CFX_FloatRect rcClient = CPWL_Utils::DeflateRect(
-      rcWindow, (FX_FLOAT)(GetBorderWidth() + GetInnerBorderWidth()));
+      rcWindow, (float)(GetBorderWidth() + GetInnerBorderWidth()));
   if (CPWL_ScrollBar* pVSB = GetVScrollBar())
     rcClient.right -= pVSB->GetScrollBarWidth();
 
@@ -700,7 +700,7 @@
 
 void CPWL_Wnd::RePosChildWnd() {
   CFX_FloatRect rcContent = CPWL_Utils::DeflateRect(
-      GetWindowRect(), (FX_FLOAT)(GetBorderWidth() + GetInnerBorderWidth()));
+      GetWindowRect(), (float)(GetBorderWidth() + GetInnerBorderWidth()));
 
   CPWL_ScrollBar* pVSB = GetVScrollBar();
 
@@ -767,11 +767,11 @@
   return CPWL_Utils::InflateRect(GetWindowRect(), 1);
 }
 
-FX_FLOAT CPWL_Wnd::GetFontSize() const {
+float CPWL_Wnd::GetFontSize() const {
   return m_sPrivateParam.fFontSize;
 }
 
-void CPWL_Wnd::SetFontSize(FX_FLOAT fFontSize) {
+void CPWL_Wnd::SetFontSize(float fFontSize) {
   m_sPrivateParam.fFontSize = fFontSize;
 }
 
diff --git a/fpdfsdk/pdfwindow/PWL_Wnd.h b/fpdfsdk/pdfwindow/PWL_Wnd.h
index 55836d4..ded003c 100644
--- a/fpdfsdk/pdfwindow/PWL_Wnd.h
+++ b/fpdfsdk/pdfwindow/PWL_Wnd.h
@@ -204,7 +204,7 @@
   CPWL_Color sBorderColor;            // optional
   CPWL_Color sTextColor;              // optional
   int32_t nTransparency;              // optional
-  FX_FLOAT fFontSize;                 // optional
+  float fFontSize;                    // optional
   CPWL_Dash sDash;                    // optional
   void* pAttachedData;                // optional
   CPWL_Wnd* pParentWnd;               // ignore
@@ -269,8 +269,8 @@
   virtual void KillFocus();
   virtual void SetCursor();
   virtual void SetVisible(bool bVisible);
-  virtual void SetFontSize(FX_FLOAT fFontSize);
-  virtual FX_FLOAT GetFontSize() const;
+  virtual void SetFontSize(float fFontSize);
+  virtual float GetFontSize() const;
 
   virtual CFX_FloatRect GetFocusRect() const;
   virtual CFX_FloatRect GetClientRect() const;
diff --git a/fpdfsdk/pdfwindow/cpwl_color.cpp b/fpdfsdk/pdfwindow/cpwl_color.cpp
index 9c9ca3e..689c3de 100644
--- a/fpdfsdk/pdfwindow/cpwl_color.cpp
+++ b/fpdfsdk/pdfwindow/cpwl_color.cpp
@@ -10,14 +10,11 @@
 
 namespace {
 
-bool InRange(FX_FLOAT comp) {
+bool InRange(float comp) {
   return comp >= 0.0f && comp <= 1.0f;
 }
 
-CPWL_Color ConvertCMYK2GRAY(FX_FLOAT dC,
-                            FX_FLOAT dM,
-                            FX_FLOAT dY,
-                            FX_FLOAT dK) {
+CPWL_Color ConvertCMYK2GRAY(float dC, float dM, float dY, float dK) {
   if (!InRange(dC) || !InRange(dM) || !InRange(dY) || !InRange(dK))
     return CPWL_Color(COLORTYPE_GRAY);
   return CPWL_Color(
@@ -25,25 +22,25 @@
       1.0f - std::min(1.0f, 0.3f * dC + 0.59f * dM + 0.11f * dY + dK));
 }
 
-CPWL_Color ConvertGRAY2CMYK(FX_FLOAT dGray) {
+CPWL_Color ConvertGRAY2CMYK(float dGray) {
   if (!InRange(dGray))
     return CPWL_Color(COLORTYPE_CMYK);
   return CPWL_Color(COLORTYPE_CMYK, 0.0f, 0.0f, 0.0f, 1.0f - dGray);
 }
 
-CPWL_Color ConvertGRAY2RGB(FX_FLOAT dGray) {
+CPWL_Color ConvertGRAY2RGB(float dGray) {
   if (!InRange(dGray))
     return CPWL_Color(COLORTYPE_RGB);
   return CPWL_Color(COLORTYPE_RGB, dGray, dGray, dGray);
 }
 
-CPWL_Color ConvertRGB2GRAY(FX_FLOAT dR, FX_FLOAT dG, FX_FLOAT dB) {
+CPWL_Color ConvertRGB2GRAY(float dR, float dG, float dB) {
   if (!InRange(dR) || !InRange(dG) || !InRange(dB))
     return CPWL_Color(COLORTYPE_GRAY);
   return CPWL_Color(COLORTYPE_GRAY, 0.3f * dR + 0.59f * dG + 0.11f * dB);
 }
 
-CPWL_Color ConvertCMYK2RGB(FX_FLOAT dC, FX_FLOAT dM, FX_FLOAT dY, FX_FLOAT dK) {
+CPWL_Color ConvertCMYK2RGB(float dC, float dM, float dY, float dK) {
   if (!InRange(dC) || !InRange(dM) || !InRange(dY) || !InRange(dK))
     return CPWL_Color(COLORTYPE_RGB);
   return CPWL_Color(COLORTYPE_RGB, 1.0f - std::min(1.0f, dC + dK),
@@ -51,13 +48,13 @@
                     1.0f - std::min(1.0f, dY + dK));
 }
 
-CPWL_Color ConvertRGB2CMYK(FX_FLOAT dR, FX_FLOAT dG, FX_FLOAT dB) {
+CPWL_Color ConvertRGB2CMYK(float dR, float dG, float dB) {
   if (!InRange(dR) || !InRange(dG) || !InRange(dB))
     return CPWL_Color(COLORTYPE_CMYK);
 
-  FX_FLOAT c = 1.0f - dR;
-  FX_FLOAT m = 1.0f - dG;
-  FX_FLOAT y = 1.0f - dB;
+  float c = 1.0f - dR;
+  float m = 1.0f - dG;
+  float y = 1.0f - dB;
   return CPWL_Color(COLORTYPE_CMYK, c, m, y, std::min(c, std::min(m, y)));
 }
 
@@ -135,7 +132,7 @@
                     static_cast<int32_t>(ret.fColor3 * 255));
 }
 
-CPWL_Color CPWL_Color::operator-(FX_FLOAT fColorSub) const {
+CPWL_Color CPWL_Color::operator-(float fColorSub) const {
   CPWL_Color sRet(nColorType);
   switch (nColorType) {
     case COLORTYPE_TRANSPARENT:
@@ -156,7 +153,7 @@
   return sRet;
 }
 
-CPWL_Color CPWL_Color::operator/(FX_FLOAT fColorDivide) const {
+CPWL_Color CPWL_Color::operator/(float fColorDivide) const {
   CPWL_Color sRet(nColorType);
   switch (nColorType) {
     case COLORTYPE_TRANSPARENT:
diff --git a/fpdfsdk/pdfwindow/cpwl_color.h b/fpdfsdk/pdfwindow/cpwl_color.h
index f1b34c7..6eae487 100644
--- a/fpdfsdk/pdfwindow/cpwl_color.h
+++ b/fpdfsdk/pdfwindow/cpwl_color.h
@@ -11,10 +11,10 @@
 
 struct CPWL_Color {
   CPWL_Color(int32_t type = COLORTYPE_TRANSPARENT,
-             FX_FLOAT color1 = 0.0f,
-             FX_FLOAT color2 = 0.0f,
-             FX_FLOAT color3 = 0.0f,
-             FX_FLOAT color4 = 0.0f)
+             float color1 = 0.0f,
+             float color2 = 0.0f,
+             float color3 = 0.0f,
+             float color4 = 0.0f)
       : nColorType(type),
         fColor1(color1),
         fColor2(color2),
@@ -28,8 +28,8 @@
         fColor3(b / 255.0f),
         fColor4(0) {}
 
-  CPWL_Color operator/(FX_FLOAT fColorDivide) const;
-  CPWL_Color operator-(FX_FLOAT fColorSub) const;
+  CPWL_Color operator/(float fColorDivide) const;
+  CPWL_Color operator-(float fColorSub) const;
 
   CPWL_Color ConvertColorType(int32_t other_nColorType) const;
 
@@ -44,10 +44,10 @@
   }
 
   int32_t nColorType;
-  FX_FLOAT fColor1;
-  FX_FLOAT fColor2;
-  FX_FLOAT fColor3;
-  FX_FLOAT fColor4;
+  float fColor1;
+  float fColor2;
+  float fColor3;
+  float fColor4;
 };
 
 #endif  // FPDFSDK_PDFWINDOW_CPWL_COLOR_H_
